Originally Posted by Marllun
Use esse cуdigo.
PHP код:
public OnPlayerEnterCheckpoint(playerid)
{
new vehicleid2 = GetPlayerVehicleID(playerid);
new modelid2 = GetVehicleModel(vehicleid2);
if(ccp[playerid] == 1)
{
if(modelid2 == 411) //ID DO VEНCULO https://sampwiki.blast.hk/wiki/Vehicles:All
{
DisablePlayerCheckpoint(playerid);
ccp[playerid] = 2;
SetPlayerCheckpoint(playerid, 1150.4137, -1572.1168, 12.8458, 6.5);
GameTextForPlayer(playerid, "Carregando...!", 5000, 6), PlayerPlaySound(playerid, 1139, 0.0, 0.0, 0.0);
TogglePlayerControllable(playerid, 0);
SetTimerEx("DescongelarP", 1000, false, "d", playerid);
}
else
{
SendClientMessage(playerid,-1,"CARRO ERRADO");
}
return 1;
}
if(ccp[playerid] == 2)
{
if(modelid2 == 411)
{
DisablePlayerCheckpoint(playerid);
ccp[playerid] = 0;
GivePlayerMoney(playerid, GetPlayerMoney(playerid) + random(5000) + 1000);
GameTextForPlayer(playerid, "Descarregando...!", 5000, 6), PlayerPlaySound(playerid, 1139, 0.0, 0.0, 0.0);
TogglePlayerControllable(playerid, 0);
SetTimerEx("DescongelarP", 1000, false, "d", playerid);
}
else
{
SendClientMessage(playerid,-1,"CARRO ERRADO");
}
return 1;
}
return 1;
}
forward DescongelarP(playerid);
public DescongelarP(playerid)
{
TogglePlayerControllable(playerid, 1);
return 1;
}
|