SendPlayerMessageToPlayer(Body_Guard,senderid,"I Need Body Guard!");
E:\Freeroam World\filterscripts\Jobs.pwn(98) : error 035: argument type mismatch (argument 1)
new Body_Guard[MAX_PLAYERS];
SendPlayerMessageToPlayer(Body_Guard[playerid],senderid,"I Need Body Guard!");
Yeah, exactly. Body_Guard is an array whereas the first parameter in SendPlayerMessageToPlayer should be an integer, usually playerid. What exactly are you trying to achieve with this?
|
new Body_Guard[MAX_PLAYERS];
if (strcmp("/NeedBG", cmdtext, true, 10) == 0)
{
if(GetPlayerMoney(playerid) < 500) return SendClientMessage(playerid,red,"You Need 500$ To Send This Message");
SendPlayerMessageToPlayer(Body_Guard,senderid,"I Need Body Guard!");
GivePlayerMoney(playerid,-500);
return 1;
}
new Body_Guard[MAX_PLAYERS];
for(new b; b < MAX_PLAYERS; b++)
{
SendPlayerMessageToPlayer(Body_Guard[b], senderid,"I need a bodyguard!");
}
for(new b=0; b<MAX_PLAYERS; b++)
{
if(Body_Guard[b] != 0) SendMessageToPlayer(Body_Guard[b]. senderid, "I need a bodyguard!");
}
pawn Код:
pawn Код:
|
E:\Freeroam World\filterscripts\Jobs.pwn(99) : error 017: undefined symbol "senderid" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.
The above won't work.
Loop through every ID and at each loop check if the player is actually a bodyguard before sending the message. pawn Код:
|
E:\Freeroam World\filterscripts\Jobs.pwn(99) : error 017: undefined symbol "SendMessageToPlayer" E:\Freeroam World\filterscripts\Jobs.pwn(99) : error 029: invalid expression, assumed zero E:\Freeroam World\filterscripts\Jobs.pwn(99) : error 017: undefined symbol "senderid" E:\Freeroam World\filterscripts\Jobs.pwn(99) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
new str[128], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
for(new b; b<MAX_PLAYERS; b++)
{
format(str, sizeof(str), "{00CCCC}%s {FFFFFF}needs a bodyguard!", name);
SendClientMessage(Body_Guard[b],0xFFFFFFAA, str);
}