14.05.2018, 10:45
I need help everytime player drives on the left side of the road there should be a gametext that'll show the player that he's driving in the left side and I want the player to get 1 star every 5 seconds on driving in the left side
i've tried it but i failed. (I'm new in scripting sorry)
i've tried it but i failed. (I'm new in scripting sorry)
Код:
forward OnPlayerGhostDriving(playerid, zone, Float:X, Float:Y, Float:Z, Float:A);
public OnPlayerGhostDriving(playerid, zone, Float:X, Float:Y, Float:Z, Float:A)
{
//Example:
GameTextForPlayer(playerid, "~r~Drive in the right side of the road !", 1000, 4);
// Start a 5 second timer to end the Timer
SetTimerEx("EndTimer", 5000, false, "i", playerid);
return 1;
}
forward OnPlayerDrivingOnTrainTrack(playerid, zone, Float:X, Float:Y, Float:Z);
public OnPlayerDrivingOnTrainTrack(playerid, zone, Float:X, Float:Y, Float:Z)
{
//example:
GameTextForPlayer(playerid, "~r~Do not drive on~n~the train tracks!", 1000, 4);
SetTimerEx("EndTimer1", 5000, false, "i", playerid);
return 1;
}
// The timer function - the code to be executed when the timer is called goes here
forward EndTimer(playerid);
public EndTimer(playerid)
{
if ( GetPlayerWantedLevel(playerid) > 0 ) // If player has 1 or more stars
{
GameTextForPlayer(playerid, "~r~Do not drive on~n~the train tracks!", 1000, 4);
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 1);
}
}
forward EndTimer1(playerid);
// The timer function - the code to be executed when the timer is called goes here
public EndTimer1(playerid)
{
// Let's notify them also
GameTextForPlayer(playerid, "~r~Do not drive on~n~the train tracks!", 1000, 4);
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 1);
return 1;
}



i'll update after it.
