SA-MP Forums Archive
/drag - Problem - 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)
+--- Thread: /drag - Problem (/showthread.php?tid=403965)



/drag - Problem - R9 - 01.01.2013

That's work but when u /drag somone cuffed that's not happense...

Quote:

CMD:drag(playerid, params[])
{
if(IsACop(playerid))
{
new string[128], giveplayerid;
if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /drag [playerid]");

if(IsPlayerConnected(giveplayerid))
{
if(GetPVarInt(giveplayerid, "PlayerCuffed") == 2)
{
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessageEx(playerid, COLOR_WHITE, " You must be out of the vehicle to use this command.");
if(GetPVarInt(giveplayerid, "BeingDragged") == 1)
{
SendClientMessageEx(playerid, COLOR_WHITE, " That player is already being dragged. ");
return 1;
}
new Float:dX, Float:dY, Float:dZ;
GetPlayerPos(giveplayerid, dX, dY, dZ);
if(!IsPlayerInRangeOfPoint(playerid, 5.0, dX, dY, dZ))
{
SendClientMessageEx(playerid, COLOR_GRAD2, " That suspect is not near you.");
return 1;
}
format(string, sizeof(string), "* %s has is now dragging you.", GetPlayerNameEx(playerid));
SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
format(string, sizeof(string), "* You are now dragging %s, you may move them now.", GetPlayerNameEx(giveplayerid));
SendClientMessageEx(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "* %s grabs ahold of %s and begins to move them.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
SendClientMessageEx(playerid, COLOR_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(playerid, COLOR_WHITE, " The specified player is not cuffed !");
}
}
}
else
{
SendClientMessageEx(playerid, COLOR_GREY, " You are not a LEO ! ");
return 1;
}
return 1;
}




Re: /drag - Problem - Tamer - 01.01.2013

Use PutPlayerInCar


Re: /drag - Problem - R9 - 01.01.2013

Quote:
Originally Posted by Tamer T
Посмотреть сообщение
Use PutPlayerInCar
Where?


Re: /drag - Problem - Diorturato - 01.01.2013

Where it you need.


Re: /drag - Problem - R9 - 01.01.2013

Quote:
Originally Posted by Diorturato
Посмотреть сообщение
Where it you need.
What? Can someone only say to me what i going to do i dont understand


Re: /drag - Problem - -CaRRoT - 01.01.2013

Can you explain more ? What's wrong with the code and what do you want to get changed ?


Re: /drag - Problem - Vinninho - 01.01.2013

You only get the cuffed persons position, but you want it to move. Use a timer & SetPlayerPos(your variable) to determine how often you want the cuffed person to be teleported.


Re: /drag - Problem - R9 - 01.01.2013

Quote:
Originally Posted by Vinninho
Посмотреть сообщение
You only get the cuffed persons position, but you want it to move. Use a timer & SetPlayerPos(your variable) to determine how often you want the cuffed person to be teleported.
The problem is when you are cuffed you can't make /drag
I want to make so when you are cuffed you can make /drag