30.07.2009, 00:37
Quote:
Originally Posted by Don Correlli
Change:
pawn Код:
pawn Код:
|
Can you fix my 3 commands, they work as in for what they are suppose to do, but they are messed up in what they are suppose to display, and i tryed to fix it on my own and it didnt work....
The cuff command. It should display as soon as someone is not part of the TEAM_COP it should display "Only Law enforcement agents can use this command!" but when someone that isnt part of the TEAM_COP and that person type /cuff it displays "USAGE: /cuff [playerid]" and when i type /cuff 5 it says ""[ERROR]: That ID not an active player " I just want it to display ""Only Law enforcement agents can use this command!"" and nothing else if they are not police
Код:
{ new cmd[256]; new tmp[256]; new idx; cmd = strtok(cmdtext, idx); if (strcmp("/cuff", cmd, true) == 0) { new giveplayerid; new giveplayer[MAX_PLAYER_NAME]; new sendername[MAX_PLAYER_NAME]; tmp = strtok(cmdtext, idx); if(gTeam[giveplayerid] == TEAM_COP) return SendClientMessage(playerid,COLOR_ORANGE,"Only Law enforcement agents can use this command!"); if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_ORANGE,"USAGE: /cuff [playerid]"); if(IsPlayerConnected(strval(tmp)) == 0) return SendClientMessage(playerid, COLOR_ORANGE, "[ERROR]: That ID not an active player "); giveplayerid = ReturnUser(tmp); if(gTeam[playerid] == TEAM_COP) { if(gTeam[giveplayerid] == TEAM_COP) return SendClientMessage(playerid,0xAA3333AA,"You cannot cuff cops !"); TogglePlayerControllable(giveplayerid,0); GetPlayerName(giveplayerid,giveplayer,sizeof(giveplayer)); GetPlayerName(playerid,sendername,sizeof(sendername)); format(tmp,sizeof(tmp),"You have cuffed %s",giveplayer); SendClientMessage(playerid,0x33AA33AA,tmp); format(tmp,sizeof(tmp),"You have been cuffed by %s",sendername); SendClientMessage(giveplayerid,0xAA3333AA,tmp); } else return SendClientMessage(playerid,COLOR_GREY, "You are not a cop!"); return 1; }
Код:
if (strcmp("/uncuff", cmd, true) == 0) { new giveplayerid; new giveplayer[MAX_PLAYER_NAME]; new sendername[MAX_PLAYER_NAME]; tmp = strtok(cmdtext, idx); if(gTeam[playerid] == TEAM_COP) SendClientMessage(playerid, COLOR_ORANGE, "Only Law Enforcement can use this command"); if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_ORANGE,"USAGE: /uncuff [playerid]"); if(IsPlayerConnected(strval(tmp)) == 0) return SendClientMessage(playerid, COLOR_ORANGE, "[ERROR]: The ID you have entered does not exist!"); giveplayerid = ReturnUser(tmp); if(gTeam[playerid] == TEAM_COP) { if(gTeam[giveplayerid] == TEAM_COP) return SendClientMessage(playerid,0xAA3333AA,"You cannot cuff police officers !"); TogglePlayerControllable(giveplayerid,1); GetPlayerName(giveplayerid,giveplayer,sizeof(giveplayer)); GetPlayerName(playerid,sendername,sizeof(sendername)); format(tmp,sizeof(tmp),"You have uncuffed %s",giveplayer); SendClientMessage(playerid,0x33AA33AA,tmp); format(tmp,sizeof(tmp),"You have been uncuffed by %s",sendername); SendClientMessage(giveplayerid,0xAA3333AA,tmp); } else return SendClientMessage(playerid,COLOR_GREY, "You are not a cop!"); return 0; }
Код:
if (strcmp("/taze", cmd, true) == 0) { new giveplayerid; new giveplayer[MAX_PLAYER_NAME]; new sendername[MAX_PLAYER_NAME]; tmp = strtok(cmdtext, idx); if(gTeam[playerid] == TEAM_COP) SendClientMessage(playerid, COLOR_ORANGE, "Only Law Enforcement can use this command"); if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_ORANGE,"USAGE: /taze [playerid]"); if(IsPlayerConnected(strval(tmp)) == 0) return SendClientMessage(playerid, COLOR_ORANGE, "[ERROR]: The ID you have entered does not exist!"); giveplayerid = ReturnUser(tmp); if(gTeam[playerid] == TEAM_COP) { if(gTeam[giveplayerid] == TEAM_COP) return SendClientMessage(playerid,0xAA3333AA,"You cannot taze police officers !"); TogglePlayerControllable(giveplayerid,0); GetPlayerName(giveplayerid,giveplayer,sizeof(giveplayer)); GetPlayerName(playerid,sendername,sizeof(sendername)); format(tmp,sizeof(tmp),"You have tazed %s",giveplayer); SendClientMessage(playerid,0x33AA33AA,tmp); format(tmp,sizeof(tmp),"You have been tazed by %s",sendername); SendClientMessage(giveplayerid,0xAA3333AA,tmp); PlayerTazed[playerid] = true; SetTimerEx("Taze",8*1000,0,"i",playerid); } return 1; }