Cuff Tell Cop - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Cuff Tell Cop (
/showthread.php?tid=114609)
Cuff Tell Cop -
hector_williams - 20.12.2009
I want my /cuff Command to say to the person who uses the command, that they have cuffed the player
for example, when a cop uses /cuff 2 it already tells ID 2 that they have been cuffed, but i want it to sendclientmessage to the cop who uses that command that player id 2 has been cuffed.
If someone could show me how to do that, it would be nice. Thanks
Код:
if(!strcmp(cmd,"/cuff",true))
{
if(gTeam[playerid] == 2 || IsACop(playerid))
{
tmp=strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /cuff playerid");
giveplayerid = ReturnUser(tmp);
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid,COLOR_GREY,"Invalid player id.");
TogglePlayerControllable(giveplayerid,0);
GameTextForPlayer(giveplayerid, "~y~ You have been Cuffed!",2500,3);
}
return true;
}
if(!strcmp(cmd,"/uncuff",true))
{
if(gTeam[playerid] == 2 || IsACop(playerid))
{
tmp=strtok(cmdtext,idx);
if(!strlen(tmp)) return SendClientMessage(playerid,COLOR_GREY,"USAGE: /uncuff playerid");
giveplayerid = ReturnUser(tmp);
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid,COLOR_GREY,"Invalid player id.");
TogglePlayerControllable(giveplayerid,1);
GameTextForPlayer(giveplayerid, "~y~ You have been Uncuffed!",2500,3);
}
return true;
}
Re: Cuff Tell Cop -
DiddyBop - 20.12.2009
Use format string thingies..like..
pawn Код:
new string[64];
format(string, sizeof(string), "You Cuffed/Uncuffed %s.", cuffedplayer);
SendClientMessage(playerid, COLOR_WHITE, string);
Somthing like that.. of course not exactly but you get idea.