30.07.2009, 00:02
For my /taze command i only want it to work for cops...but i dunno what im doing wrong...it doesnt work for cops but it works for other teams..
Heres the code:
Heres the code:
Код:
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; }