21.05.2011, 17:43
I have a problem with code: /foradmins [text here] . This command need to send message from a player for admins but if player admin and he sent this message to other admins. This message repeats for him 2x times. How i can make what if player is admin and he sent message to other admins he can see only one message not two![Huh?](images/smilies/confused.gif)
2. There is an epic problem if player sent this message for admins, they don't get this message, but simple players which is not and admin gets this message. How i can make what this message can get only admins: There is my code: (I am using zcmd)![Smiley](images/smilies/smile.png)
![Huh?](images/smilies/confused.gif)
2. There is an epic problem if player sent this message for admins, they don't get this message, but simple players which is not and admin gets this message. How i can make what this message can get only admins: There is my code: (I am using zcmd)
![Smiley](images/smilies/smile.png)
Код:
COMMAND:foradmins( playerid, params[ ] ) { if(!params[0]) { new zin[256] = "Admins online:"; new name[MAX_PLAYER_NAME], x; for(new i = 0; i <MAX_PLAYERS; i++){ if(IsPlayerConnected(i) && isPlayerAnAdmin(playerid,2)){ x++; GetPlayerName(i,name,MAX_PLAYER_NAME); format(zin,256,"%i. %s.",x,name); SendClientMessage(playerid,0xFFFFFFFF,zin); } } return 1; } new zin[256],name[MAX_PLAYER_NAME]; GetPlayerName(playerid,name,MAX_PLAYER_NAME); format(zin,sizeof(zin),"%s for admins: %s",name,params[0]); for(new i = 0; i <MAX_PLAYERS; i++) { if(IsPlayerConnected(i) && isPlayerAnAdmin(playerid,2)) { SendClientMessage(i,0xFF8000FF,zin); } } SendClientMessage(playerid,0xFF8000FF,zin); return 1; }