SA-MP Forums Archive
Adding a new /accepthelpme system and it doesn't work - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Adding a new /accepthelpme system and it doesn't work (/showthread.php?tid=424046)



Adding a new /accepthelpme system and it doesn't work - Spose - 20.03.2013

Alright, so I'm am adding a new "/(a)ccept(h)elp(m)e" system, but when I was trying to compile it, I got a few errors.


Код:
(23117)warning 202: number of arguments does not match definition
(23117) : warning 202: number of arguments does not match definition
(23120) : warning 202: number of arguments does not match definition
(23120) : warning 202: number of arguments does not match definition
(23120) : warning 202: number of arguments does not match definition
(23120) : warning 202: number of arguments does not match definition
Now, I'm not quite sure why I get these errors (basically why I need help), and I'd appreciate if someone could try to help me.

These are the

Код:
23117       format(string, sizeof(string), "Helper %s has accepted your help request, please be pateint.", GetPlayerName(playerid), result);
23120       format(string, sizeof(string), "[Helper Message]Helper %s has accepted the help request from %s[ID:     [%s]", GetPlayerName(giveplayerid), GetPlayerName(playerid));
23121       SendHelperMessage(string);



Re: Adding a new /accepthelpme system and it doesn't work - Misiur - 20.03.2013

https://sampwiki.blast.hk/wiki/GetPlayerName takes 3 arguments


Re: Adding a new /accepthelpme system and it doesn't work - Spose - 20.03.2013

Quote:
Originally Posted by Misiur
Посмотреть сообщение
Yeah, so? (not trying to be rude if that what it sounds like, just want an explenation)


Re: Adding a new /accepthelpme system and it doesn't work - Misiur - 20.03.2013

Quote:

GetPlayerName(giveplayerid)

Quote:

number of arguments does not match definition

I don't know, do you?


Re: Adding a new /accepthelpme system and it doesn't work - Spose - 20.03.2013

Quote:
Originally Posted by Misiur
Посмотреть сообщение
I don't know, do you?
Added
Код:
         format(string, sizeof(string), "[Helper Message]Helper %s has accepted the help request from %s[ID:     [%s]", GetPlayerName(giveplayerid, const name[], len), GetPlayerName(playerid, const name[], len));
And now it says
Код:
(23120) : error 029: invalid expression, assumed zero
(23120) : error 017: undefined symbol "name"
(23120) : error 029: invalid expression, assumed zero
(23120) : fatal error 107: too many error messages on one line
instead.


Re: Adding a new /accepthelpme system and it doesn't work - Spose - 20.03.2013

Changed it once agian to

Код:
 sendername, result;
and now that's fine, but now I get

Код:
(23120) : error 017: undefined symbol "result"
(23120) : error 001: expected token: ",", but found ";"
(23121) : error 035: argument type mismatch (argument 1)



Re: Adding a new /accepthelpme system and it doesn't work - Misiur - 20.03.2013

Oh boy.

pawn Код:
GetPlayerName(playerid, const name[], len)
This is function definition. It tells you that function requires: 1. id of a player 2. string to which the name will be saved, 3. length of the string

pawn Код:
new playerName[MAX_PLAYER_NAME + 1], otherName[MAX_PLAYER_NAME + 1];
GetPlayerName(playerid, playerName, sizeof playerName);
format(string, sizeof(string), "Helper %s has accepted your help request, please be pateint.", playerName, result);

//(...)
GetPlayerName(giveplayerid, otherName, sizeof otherName);
format(string, sizeof(string), "[Helper Message]Helper %s has accepted the help request from %s[ID:     [%s]", otherName, playerName);