What is not correct about this? Help. - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: What is not correct about this? Help. (
/showthread.php?tid=257478)
What is not correct about this? Help. -
Gemini - 26.05.2011
I am learning to use dcmd to create teleports, but why doesnt this code work properly?
PHP код:
dcmd_drift1(playerid, params[])
{
#pragma unused params
SetPlayerInterior(playerid,0);
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
{
SendClientMessage(playerid,COLOR_RED,"You must be the driver to teleport this vehicle!");
}
else
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(playerid,-355.2756,1529.9248,75.3594);
}
else
{
SetPlayerPos(playerid,-355.2756,1529.9248,75.3594);
}
}
return 1;
}
as you can see, I want persons to be teleported to big ear drift when they write /drift1. IF a player is in any vehicle he will be teleported, and also if a player is on foot (I will change the coords later so that if player is on foot he will be teleported else where). AND IF a player is as a passenger in someones car, he can not teleport the vehicle.
But for some reason, the teleporting for persons IN VEHICLES does not work. Help please.
Thanks in advance.
Re: What is not correct about this? Help. -
pen_theGun - 26.05.2011
Quote:
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
SetVehiclePos(playerid,-355.2756,1529.9248,75.3594);
}
else
{
SetPlayerPos(playerid,-355.2756,1529.9248,75.3594);
}
|
Its should be vehicleid, not playerid
ClickMe