17.01.2011, 22:37
im trying to make a /n or /new for my RP server it works but people can spam it how do i set a 30 second timer on it? this is what i got so far please halp!
Quote:
if(strcmp(cmd, "/n", true) == 0 || strcmp(cmd, "/new", true) == 0) { if(IsPlayerConnected(playerid)) { if(gPlayerLogged[playerid] == 0) { SendClientMessage(playerid, COLOR_GREY, " You havent logged in yet !"); return 1; } if(PlayerInfo[playerid][pMuted] == 1) { SendClientMessage(playerid, TEAM_CYAN_COLOR, " You can't speak, you have been silenced !"); return 1; } GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/n)ew [Newbie Chat]"); return 1; } format(string, sizeof(string), " Player %s: %s " , sendername, result); OOCOff(0x33CCFFAA,string); printf("%s", string); } return 1; } |