17.11.2012, 12:48
Hey! I have a problem with my /su CMD, it's a little buggy. It works well when i type the comand: when i type "/su roller 1 Stealling a police car" it works! but then when he has W1 i type "/su roller 2 ..." it gives him W6553!
Thanks for Helping me!
Код:
CMD:suspect(playerid,params[]) { if(PlayerInfo[playerid][pFaction] == 1 || PlayerInfo[playerid][pLeader] == 1) { if(PlayerInfo[playerid][pLogged] == 0) return SendClientMessage(playerid,COLOR_WHITE,"*** Trebuie sa te logezi/inregistrezi mai intai."); if(CopOnDuty[playerid] == 0) return SendClientMessage(playerid,COLOR_WHITE,"You are not on Duty!"); new id,wantedlevel,crime[128],string[128]; new CopName[MAX_PLAYER_NAME],SuspectName[MAX_PLAYER_NAME]; if(sscanf(params,"uus[128]",id,wantedlevel,crime)) return SendClientMessage(playerid,COLOR_WHITE,"Usage: (/su)spect [playerid] [1-6] [crime]"); if(playerid == id) return SendClientMessage(playerid,COLOR_WHITE,"You cannot suspect yourself!"); if(PlayerInfo[id][pFaction] == 1 || PlayerInfo[id][pLeader] == 1) return SendClientMessage(playerid,COLOR_WHITE,"You cannot give wanted to a Cop!"); if(wantedlevel <= PlayerInfo[id][pWanted]) return SendClientMessage(playerid,COLOR_WHITE,"That player is already a suspect!"); SetPlayerWantedLevel(id,wantedlevel); PlayerInfo[id][pWanted] = wantedlevel; GetPlayerName(playerid,CopName,sizeof(CopName)); GetPlayerName(id,SuspectName,sizeof(SuspectName)); format(string,sizeof(string),"You have comited a crime: %s Reporter: %s Wanted: %d",crime,CopName,wantedlevel); SendClientMessage(id,COLOR_YELLOW,string); foreach(new i:Player) { if(PlayerInfo[i][pFaction] == 1 || PlayerInfo[i][pLeader] == 1) { format(string,sizeof(string),"Suspect: {FF0000}%s {0000FF}Crime: {FF0000}%s {0000FF}Wanted: {FF0000}%d {0000FF}Reporter: {FF0000}%s",SuspectName,crime,wantedlevel,CopName); SendClientMessage(i,0x0000FFFF,"HQ: All Units, Crime Report:"); SendClientMessage(i,0x0000FFFF,string); print("(PD/FBI/NG Chat) HQ: All Units, Crime Report:"); print(string); } } } else { SendClientMessage(playerid,COLOR_WHITE,"You are not a COP/FBI Agent/NG!"); } return 1; } CMD:su(playerid,params[]) return cmd_suspect(playerid,params);