31.07.2012, 10:19
So I found a tutorial how to chat with admins using @ [text]
And I tried to change so it would work with my admin system but not workig so help please?
Posting whole OnPlayerText
NOTE: this is on the admin system not the gamemode! // No errors or warnings!
The tutorial I found.
Thanks!
And I tried to change so it would work with my admin system but not workig so help please?
Posting whole OnPlayerText
NOTE: this is on the admin system not the gamemode! // No errors or warnings!
Код:
public OnPlayerText(playerid, text[]) { if(P_Data[playerid][pMute] == 1) { SCM(playerid, COLOR_RED, "You are muted, noone can hear you!"); return 0; } for(new words; words<sizeof(SwearWords); words++) { if(strfind(text,SwearWords[words],true) != -1 ) { SCM(playerid, COLOR_RED,"You can not swear"); return 0;} } P_Data[playerid][pSpam] += 1; if(P_Data[playerid][pSpam] == 4) { new string[128]; format(string, 128, "%s muted for flooding attempt.", GetName(playerid)); SCMToAll(-1,string); P_Data[playerid][pMute] = 1; return 0; } else if(P_Data[playerid][pSpam] == 3) { SCM(playerid,COLOR_RED,"Stop with spam or you will be muted!"); return 0; } if(P_Data[playerid][pAdmin] > 1 && text[0] == '#') { new msg[128]; format(msg, sizeof(msg), "[ADMIN CHAT] %s: %s", GetName(playerid), text[1]); } return 1; } stock SendMessageToAdmins(text[])//ACHAT { for(new i = 0, i < MAX_PLAYERS, i++) { if(P_Data[i][pAdmin] > 1) { SendClientMessage(i, -1, text); } } }
Thanks!