AttackPlayerToPlayer?
#1

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!
Reply
#2

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..
Reply
#3

so how?
Reply
#4

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)