13.06.2010, 17:55
Hey.
I need yome help to make something how i can lend a faggio or a bmx to another person.
So when he enter the vehicle he will be asked if he wants to borrow the vehicle and then save it anywhere in a variable so he can use it for 10 minutes.
Here my code that i got yet:
i really dont know if it is in the right callback...
BTW: if he answeres /ja he should get the vehicle and if he types /nein he shouldnt get it.
I need yome help to make something how i can lend a faggio or a bmx to another person.
So when he enter the vehicle he will be asked if he wants to borrow the vehicle and then save it anywhere in a variable so he can use it for 10 minutes.
Here my code that i got yet:
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if (newstate == PLAYER_STATE_DRIVER)
{
new Vehicle;
Vehicle = GetPlayerVehicleID(playerid);
for (new i=0; i<sizeof(NoobVehicles); i++)
{
if (Vehicle == NoobVehicles[i])
{
TogglePlayerControllable(playerid, 0);
Frozen[playerid] = 1;
if (GetPlayerMoney(playerid) >= 100)
{
GivePlayerMoney(playerid, -100);
SendClientMessage(playerid, YELLOW, "SERVER: Du hast dir das Auto/BMX jetzt fьr 10 Minuten ausgeliehen.");
SetTimer("RentCar", 600000, 0);
TogglePlayerControllable(playerid, 1);
Frozen[playerid] = 0;
}
else
{
SendClientMessage(playerid, RED, "SERVER: Du hast zu wenig Geld. (100$)");
TogglePlayerControllable(playerid, 1);
Frozen[playerid] = 0;
RemovePlayerFromVehicle(playerid);
}
break;
}
}
}
return 1;
}
BTW: if he answeres /ja he should get the vehicle and if he types /nein he shouldnt get it.