Adding a new /accepthelpme system and it doesn't work
#1

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);
Reply
#2

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

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

Quote:

GetPlayerName(giveplayerid)

Quote:

number of arguments does not match definition

I don't know, do you?
Reply
#5

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.
Reply
#6

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)
Reply
#7

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);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)