SA-MP Forums Archive
[Help] height - 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] height (/showthread.php?tid=566303)



[Help] height - INKISICION - 05.03.2015

create a mini game that is above the water, what I want is that the fall of track upload it back into his car

my function

pawn Код:
public OnPlayerUpdate(playerid)
{
if(InSumo[playerid] == 1)
{
new Float:pPos[3],RAND = random(sizeof(SUMO_SPAWNS)),RANDCARS = random(sizeof(SUMO_CARS));
GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
if (pPos[2] < 10.0)//If this further down the track
{
CreateVehicleEx(playerid, SUMO_CARS[RANDCARS][0], SUMO_SPAWNS[RAND][0], SUMO_SPAWNS[RAND][1], SUMO_SPAWNS[RAND][2], SUMO_SPAWNS[RAND][3]+5, -1, -1);//gives a new car > random
PutPlayerInVehicle(playerid, g_SPAWNED_VEHICLE[playerid], 0);
return 1;
}
if (GetPlayerState(playerid) != PLAYER_STATE_DRIVER)//if out of the car
{
CreateVehicleEx(playerid, SUMO_CARS[RANDCARS][0], SUMO_SPAWNS[RAND][0], SUMO_SPAWNS[RAND][1], SUMO_SPAWNS[RAND][2], SUMO_SPAWNS[RAND][3]+5, -1, -1);//gives a new car > random
PutPlayerInVehicle(playerid, g_SPAWNED_VEHICLE[playerid], 0);
}
}
return 1;
}

The problem is that every second is updating, You can not play
Someone help me?



Re: [Help] height - Excel™ - 05.03.2015

Use a timer for this purpose, OnPlayerUpdate is not appropriate and not regular as well symmetric!

Also why using RAND & RANDCARS variables for same purpose.

Also you haven't placed the checks correctly.


Re: [Help] height - INKISICION - 05.03.2015

Quote:
Originally Posted by Excel™
Посмотреть сообщение
Use a timer for this purpose, OnPlayerUpdate is not appropriate and not regular as well symmetric!

Also why using RAND & RANDCARS variables for same purpose.

Also you haven't placed the checks correctly.

Owww Thanks for your help