SA-MP Forums Archive
after cmd . . . when X(playerid) ! - 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: after cmd . . . when X(playerid) ! (/showthread.php?tid=569773)



after cmd . . . when X(playerid) ! - mamalzeus - 02.04.2015

Hi guys.
how can i write when player type cmdtext and when player enter vehicle get player checkpoint.


Re: after cmd . . . when X(playerid) ! - Abagail - 02.04.2015

pawn Код:
CMD:activate(playerid, params[])
{
     cpVar[playerid] = 1;
     return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
     if(cpVar[playerid] == 1 && vehicleid == cpVehicle)
     {
           SetPlayerCheckpoint(playerid, x, y, z, size);
     }
     return 1;
}
That's an example, not a working code. By setting a variable, and using the onplayerentervehicle callback you can set the CP.