27.11.2012, 15:21
I've tried updating it like this:
But I still get errors.
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if (newstate == 2)
{
if (oldstate == 1)
{
new
vID = GetPlayerVehicleID(playerid);
if (IsRentableCar(vID))
{
if (!IsRentedCar(vID))
{
new
String[128];
format(String, 128, "~p~~n~rent cost: ~b~%d~n~~w~type ~b~/rentcar~n~~w~to exit it type~n~~p~/exitrental", RENT_COST);
GameTextForPlayer(playerid, String, 30000, 4);
SendClientMessage(playerid, -1, "Type {3399CC}/exitrental{FFFFFF} to exit this rental car.");
TogglePlayerControllable(playerid, 0);
}
else if (IsRentedCar(vID))
{
if (GetPVarInt(playerid, "CarRentID") == vID)
{
return SendClientMessage(playerid, -1, "{3399CC}Welcome{FFFFFF} to your rented car.");
}
else if (GetPVarInt(playerid, "CarRentID") != vID)
{
new
String[128];
format(String, 128, "This vehicle is rented by: {3399CC}%s{FFFFFF}", RentedBy[vID]);
SendClientMessage(playerid, -1, String);
SendClientMessage(playerid, -1, "Use {3399CC}/exitrental{FFFFFF} to exit this vehicle.");
return 1;
}
}
}
}
}
return 0;
}