[Help]/drag command Hotkey
#1

Hey guys ,i`m making a new server and i have a problem with /drag command ,i cant add the Fire Hotkey to stop dragging the suspect if anyone knows how to do it ,Post it please
PHP код:
CMD:drag(playeridparams[])
{
if(
IsACop(playerid))
{
new 
string[128], giveplayerid;
if(
sscanf(params"u"giveplayerid)) return SendClientMessageEx(playeridCOLOR_GREY"USAGE: /drag [playerid]");
if(
IsPlayerConnected(giveplayerid))
{
if(
GetPVarInt(giveplayerid"PlayerCuffed") == 2)
{
if(
IsPlayerInAnyVehicle(playerid)) return SendClientMessageEx(playeridCOLOR_WHITE" You must be out of the vehicle to use this command.");
if(
GetPVarInt(giveplayerid"BeingDragged") == 1)
{
SendClientMessageEx(playeridCOLOR_WHITE" That player is already being dragged. ");
return 
1;
}
new 
Float:dXFloat:dYFloat:dZ;
GetPlayerPos(giveplayeriddXdYdZ);
if(!
IsPlayerInRangeOfPoint(playerid5.0dXdYdZ))
{
SendClientMessageEx(playeridCOLOR_GRAD2" That suspect is not near you.");
return 
1;
}
format(stringsizeof(string), "* %s has is now dragging you."GetPlayerNameEx(playerid));
SendClientMessageEx(giveplayeridCOLOR_WHITEstring);
format(stringsizeof(string), "* You are now dragging %s, you may move them now."GetPlayerNameEx(giveplayerid));
SendClientMessageEx(playeridCOLOR_WHITEstring);
format(stringsizeof(string), "* %s grabs ahold of %s and begins to move them."GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SendClientMessageEx(playeridCOLOR_WHITE"You are now dragging the suspect, press the '{AA3333}FIRE{FFFFFF}' button to stop.");
SetPVarInt(giveplayerid"BeingDragged"1);
SetPVarInt(playerid"DraggingPlayer"giveplayerid);
}
else
{
SendClientMessageEx(playeridCOLOR_WHITE" The specified player is not cuffed !");
}
}
}
else
{
SendClientMessageEx(playeridCOLOR_GREY" You are not a LEO ! ");
return 
1;
}
return 
0;

Reply
#2

Use the variable under OnPlayerKeyStateChange, for example

pawn Код:
if(GetPVarInt(giveplayerid, "BeingDragged") == 1)
  {
   //set the variable to 0
  }
https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange
Reply
#3

Actually i`m not a Good Scripter So,Make it for me if you can please (i`m still learning the basics of Scripting)
Reply
#4

can anyone make the command for me please ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)