Posts: 162
Threads: 28
Joined: Aug 2011
Reputation:
0
I'm making a /givecookieall.
I have this.
PlayerInfo[GiveAll][pCookies] += 1;
What's the correct fix to give everyone a cookie using that?
Thanks.
Posts: 1,765
Threads: 1
Joined: Aug 2011
Reputation:
0
YOu should be using your player info and creating a loop to loop all players what are doing?
Posts: 288
Threads: 2
Joined: Sep 2009
pawn Код:
if(strcmp(cmdtext,"/givecookieall",true) == 0)
{
if(IsPlayerAdmin(playerid)
{
for(new i = 0,j = GetMaxPlayers();i<j;i++)
{
if(IsPlayerConnected(i))
{
PlayerInfo[i][pCookies] += 1;
}
}
new str[128];
new Name[25];GetPlayerName(playerid,Name,25);
format(str, 128," Administrator %s had give to all a cookie.",Name);
SendClientMessageToAll(~0, str);
}
return 1;
}
Posts: 162
Threads: 28
Joined: Aug 2011
Reputation:
0
farsek, your command gives me an error, given {, expted )
at this line
error 001: expected token: ")", but found "{"