29.09.2013, 17:47
So, i found this tutorial:
https://sampforum.blast.hk/showthread.php?tid=335123
And following it, i wanted to create an admin chat..
Well, it all worked greatly, till i added that stock and "SendMessageToAdmins(msg);"..
Script:
Stock:
When i compile it, i get this:
test.pwn(1999) : error 021: symbol already defined: "i"
test.pwn(1999) : warning 204: symbol is assigned a value that is never used: "i"
Line 1999:
for(new i = 0, i < MAX_PLAYERS, i++)
I have tried changing the 'names' removing other stuff.. but, ugh.. nothing worked.
https://sampforum.blast.hk/showthread.php?tid=335123
And following it, i wanted to create an admin chat..
Well, it all worked greatly, till i added that stock and "SendMessageToAdmins(msg);"..
Script:
Код:
public OnPlayerText(playerid,text[]) { if(IsPlayerAdmin(playerid) && text[0] == '#') { new msg[128], pName[MAX_PLAYER_NAME]; GetPlayerName(playerid, pName, MAX_PLAYER_NAME); format(msg, sizeof(msg), "[ADMIN CHAT] %s: %s", pName, text[1]); SendMessageToAdmins(msg); //Due to this stock thing get an error, i think. } return 1; }
Код:
stock SendMessageToAdmins(text[]) { for(new i = 0, i < MAX_PLAYERS, i++) { if(IsPlayerAdmin(i)) { SendClientMessage(i, -1, text); } } }
test.pwn(1999) : error 021: symbol already defined: "i"
test.pwn(1999) : warning 204: symbol is assigned a value that is never used: "i"
Line 1999:
for(new i = 0, i < MAX_PLAYERS, i++)
I have tried changing the 'names' removing other stuff.. but, ugh.. nothing worked.