Posts: 489
Threads: 218
Joined: Nov 2011
Reputation:
0
I would like to make a command like /drag ID so a player can drag another one, all the RP/CnR servers got it but i dunno how to make :/
like at 3.13
[ame]http://www.youtube.com/watch?v=qSlwUxZPy8o&list=UUNQpN_dhA3HQLSWo2c1-Gig&index=4&feature=plcp[/ame]
+REP!
Posts: 324
Threads: 78
Joined: Oct 2010
Reputation:
0
I guess you could create a timer that Gets the position of the player who used the command and then set the dragged players position to the new position of the cop..
Posts: 2,593
Threads: 34
Joined: Dec 2007
You can use OnPlayerUpdate or timer if OnPlayerUpdate is too fast
pawn Код:
new Jailed[MAX_PLAYERS]={999,...};
connect/disconnect
pawn Код:
if(Jailed[playerid] != 999)
Jailed[Jailed[playerid]] = 999;
Jailed[playerid] = 999;
in /drag id
pawn Код:
Jailed[giveplyerid] = playerid;
pawn Код:
public OnPlayerUpdate(playerid)
{
if(Jailed[playerid] != 999)
{
new Float:P[4];
GetPlayerPos(Jailed[playerid],P[0],P[1],P[2]);
GetPlayerFacingAngle(Jailed[playerid],P[3]);
P[0] -= (2.5 * floatsin(-P[3], degrees));
P[1] -= (2.5 * floatcos(-P[3], degrees));
SetPlayerPos(playerid,P[0],P[1],P[2]);
SetPlayerFacingAngle(playerid,P[3]);
}
return 1;
}