20.08.2010, 22:21
I have attempted to write a script so that when a cop enters /rights [playername] it will display Miranda rights to that player only before being arrested.
When I type /rights playername all I get displayed is
I'm starting to struggle here as it just won't work, even though I'm a leader of the SAPD faction and I have searched and searched the forums for answers.
When I complied the script, I got no errors.
Thanks in advance if anybody can help me on this and I hope I make sense
When I type /rights playername all I get displayed is
Код:
Usage: /rights (playerid)
When I complied the script, I got no errors.
Thanks in advance if anybody can help me on this and I hope I make sense
Код:
if(strcmp(cmd, "/rights", true) == 0) { if(IsPlayerConnected(playerid)) { if(gTeam[playerid] != 2) { SendClientMessage(playerid, COLOR_GREY, "** You are not a Cop!"); return 1; } if(PlayerInfo[playerid][pDBanned] == 1) { SendClientMessage(playerid, COLOR_GREY, "** You are Banned From Cop Duty!"); return 1; } if(PlayerInfo[playerid][pDuty] != 1 && PlayerInfo[playerid][pMember] == 1) { SendClientMessage(playerid, COLOR_GREY, "** You are not on Duty!"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "Usage: /rights (playerid)"); return 1; } giveplayerid = ReturnUser(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "Usage: /rights (playerid)"); return 1; } moneys = strval(tmp); if(IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { if (ProxDetectorS(8.0, playerid, giveplayerid)) { GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); //if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "Usage: /rights (playerid)"); SendClientMessage(playerid, COLOR_RED, "Usage: /rights (playerid)"); SendClientMessage(playerid, COLOR_RED, "Your rights: bla bla bla bla"); SendClientMessage(playerid, COLOR_RED, " rights continue bla bla bla"); return 1; } else { SendClientMessage(playerid, COLOR_GREY, "** That player is not near you !"); return 1; } } } else { SendClientMessage(playerid, COLOR_GREY, "** That player is Offline !"); return 1; } } return 1; }