CLEO Help SAMPFUNCS - Command help!

CLEO related
Status
Not open for further replies.

rAcs

Member
Joined
Jun 20, 2016
Messages
10
Reaction score
0
Hello guys! I want a script to send pm to another player with text "Hello, my name is Neveu"
I tried to do something but all time gave me error like " Too many players" 
This is my script:
Code:
:TW
   SAMP.IsCommandTyped(20@)
if 
0AD4: 20@ = scan_string 20@ format "%d" 21@  
jf @TW_1 
1@ = SAMP.GetPlayerNickname(21@)
say "/pm %d, My name is Neveu!" 21@ 
goto @TW_2 

:TW_1
print "~r~/TW <id>" 2000 

:TW_2
SAMP.CmdRet
 I tried to make something like that -> IF I write /tw <ID> (Player ID)  then the script writes /pm <ID> TEXT.
Anybody?
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,486
Reaction score
226
Location
( ͡° ͜ʖ ͡°)
Code:
{$CLEO .cs}
0000:


REPEAT
    WAIT 0
UNTIL 0AFA:  SAMP_IS_READY
0B34: samp register_client_command "tw" to_label @tw



WHILE TRUE
    WAIT 0
END



:tw
0B35: samp 0@ = get_last_command_params
if
0AD4: 33@ = scan_string 0@ format "%d" 1@
then
    if
    0B23:  samp is_player_connected 1@
    then
        0AF9: samp say_msg "/pm %d My name is Neveu!" 1@
        
    end
end
0B43: samp cmd_ret
 

rAcs

Member
Joined
Jun 20, 2016
Messages
10
Reaction score
0
Thank you, but i have same problem. When i write /tw ID the server says "Too many players with this ID". I don't know how i can solve this.
 
Joined
Feb 18, 2005
Messages
2,963
Reaction score
267
"Too many players with this ID" - either the script is retarded, or you're not supposed to use the sa-mp id with that command, one player can't have more than a single id.

Provide some more info.
 
Joined
Feb 18, 2005
Messages
2,963
Reaction score
267
Maybe you need to use the name and not the id? There can only be one player with id 330, so the server telling you there's too many is not logical.
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,486
Reaction score
226
Location
( ͡° ͜ʖ ͡°)
{$CLEO .cs}
0000:


REPEAT
WAIT 0
UNTIL 0AFA: SAMP_IS_READY
0B34: samp register_client_command "tw" to_label @tw



WHILE TRUE
WAIT 0
END



:tw
0B35: samp 0@ = get_last_command_params
if
0AD4: 33@ = scan_string 0@ format "%d" 1@
then
if
0B23: samp is_player_connected 1@
then
0B36: samp 2@ = get_player_nickname 1@
0AF9: samp say_msg "/pm %s My name is Neveu!" 2@

end
end
0B43: samp cmd_ret
 

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
16
Location
Romania
Neveu said:
Again, http://i.imgur.com/ZbEIaYE.png. Maybe, the problem is from script server or whatever?

I told you that to many times :). There are no logical problems in your script because just one player can have the same Id, an Example, I have ID 500 so no one will can get that ID untill I get out from the server :)

that problem comming from you not from script, this script working for me and I think for all people 

Again I will recommend you, 1. uninstall gta / or get sampfuncs 5.2+ and try this mod without other mods :).
 

rAcs

Member
Joined
Jun 20, 2016
Messages
10
Reaction score
0
Ok, i understand. I deleted all .cs mods and i had same problem. I will reinstall the GTA and i will come with an answer.
Edit: I have same problem. I reinstalled the game without mods and i recived same error.
 

shanker

Well-known member
Joined
Sep 18, 2016
Messages
291
Reaction score
16
Location
Romania
El vrea ca atunci cand da /TW [ID_JUCATOR], script-ul sa execute "0AF9: samp say_msg "/pm [ID] Jucator". L-am pus sa modifice din /PM in /W crezand ca-i un bug sau ceva de genul de la script-ul sv-ului insa tot nu-i merge cu toate ca mie imi merge :)).
 
Joined
Feb 18, 2005
Messages
2,963
Reaction score
267
Incearca sa inlaturi virgula dupa "%d", asigura-te ca in optiunile din SB, in tabul format, case converting(dreapta jos) este setat pe 'As is'.
Din poza asta, http://i.imgur.com/ZbEIaYE.png, reiese ca toti playerii au in nume "my", de la "my name ..", deci poate comanda accepta un nume si nu id?
 

rAcs

Member
Joined
Jun 20, 2016
Messages
10
Reaction score
0
Cand dau /tw Nume nu imi afiseaza nimic. Functioneaza doar cand dau /tw ID si imi apare ca si in poza pe care am dat-o. Ce ai spus tu cu "My" , MyName ai dreptate, dar nu functioneaza. Am facut si optiunea cu "As IS", dar tot nimic. Pana la urma cred ca renunt deoarece nu ii pot da de cap.
 
Status
Not open for further replies.
Top