SA-MP Forums Archive
Help me please create a command... - 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: Help me please create a command... (/showthread.php?tid=369475)



Help me please create a command... - StAsMaNn - 17.08.2012

Hello. I have a Race FS. So when player choose race, fs tp him to the 1 checkpoint. If player sits in the car, it tp him with the car, but if player i'snt in a vehicle, it don't tp him, just shows him where is the checkpoint... So can anybody help me what command i need to create that if player will be in a vehicle... it will tp, and if he do no sit in a vehicle, it still will tp him...
Here is the commad
#if defined TELEPORT_TO_START
SetVehiclePos(GetPlayerVehicleID(playerid),Checkpo intGara[listitem][0][CXPos],CheckpointGara[listitem][0][CYPos],CheckpointGara[listitem][0][CZPos]);
SendClientMessage(playerid,BIANCO,"[Ãîíêà:] Âû çàøëè íà ãîíêó. Ââåäèòå \"{C14124}/Ready{FFFFFF}\" êîãäà âû áóäåòå ãîòîâû.");
SendClientMessage(playerid,BIANCO,"[Ãîíêà:] ×òîáû âûéòè ñ ãîíêè ââåäèòå \"{C14124}/quitrace{FFFFFF}\"");
#else
SendClientMessage(playerid,BIANCO,"[Ãîíêà:] You join the race. Go to the checkpoint and type \"{C14124}/Ready{FFFFFF}\" when you are ready");
#endif


Re: Help me please create a command... - StAsMaNn - 17.08.2012

I know the code now...
if(IsPlayerInAnyVehicle(playerid))
{
SetVehiclePos(GetPlayerVehicleID(playerid),Checkpo intGara[listitem][0][CXPos],CheckpointGara[listitem][0][CYPos],CheckpointGara[listitem][0][CZPos]);
}
else
{
SetPlayerPos(playerid,CheckpointGara[listitem][0][CXPos],CheckpointGara[listitem][0][CYPos],CheckpointGara[listitem][0][CZPos]);
}


Re: Help me please create a command... - Dare Devil..... - 17.08.2012

First of all we arent macines so we can read it wrap it in [pawn]

Like this
pawn Код:
I know the code now...
if(IsPlayerInAnyVehicle(playerid))
{
SetVehiclePos(GetPlayerVehicleID(playerid),Checkpo intGara[listitem][0][CXPos],CheckpointGara[listitem][0][CYPos],CheckpointGara[listitem][0][CZPos]);
}
else
{
SetPlayerPos(playerid,CheckpointGara[listitem][0][CXPos],CheckpointGara[listitem][0][CYPos],CheckpointGara[listitem][0][CZPos]);
}
Do the same thing with other also so its readable.