17.06.2015, 20:44
So i have a problem with this system, its a bus driver system and the check points are not working, which means when i enter checkpoint it should show me
and when i leave it
Codes:
First when u start a system it goes like this
And when u enter CP
And when u leave cp
Other:
pawn Код:
GameTextForPlayer(playerid,"~y~Stanica", 6000, 3);
pawn Код:
GameTextForPlayer(playerid, "~g~Nova stanica locirana", 3000, 3);
First when u start a system it goes like this
pawn Код:
SetPlayerCheckpoint(playerid,2027.5176,-1939.9084,13.3362,5.0);//
VoziAutobus[playerid] = 1;
pawn Код:
if(VoziAutobus[playerid] < 104)
{
if(IsPlayerInRangeOfPoint(playerid,8.0,BusLinijaCp[VoziAutobus[playerid]-1][0],BusLinijaCp[VoziAutobus[playerid]-1][1],BusLinijaCp[VoziAutobus[playerid]-1][2]))
{
if(VoziloBuser(GetPlayerVehicleID(playerid)))
{
new currentState = GetPlayerState(playerid);
if (currentState == PLAYER_STATE_PASSENGER)
{
DisablePlayerCheckpoint(playerid);
SetPVarInt(playerid, "Busruta_Var", 0);
TogglePlayerControllable(playerid, 0);
GameTextForPlayer(playerid,"~r~Moras biti vozac!", 5000, 1);
}
if(BusKretanje[playerid] >= sekundaigre) return 1;
else if(BusKretanje[playerid] == 0)
{
BusKretanje[playerid] += 5;
GameTextForPlayer(playerid,"~y~Stanica", 6000, 3);
return 1;
}
}
}
pawn Код:
public OnPlayerLeaveCheckpoint(playerid)
{
if(VoziAutobus[playerid] > 0 && BusKretanje[playerid] > 0)
{
if(VoziAutobus[playerid] < 104)
{
if(IsPlayerInRangeOfPoint(playerid,15.0,BusLinijaCp[VoziAutobus[playerid]-1][0],BusLinijaCp[VoziAutobus[playerid]-1][1],BusLinijaCp[VoziAutobus[playerid]-1][2]))
{
if(VoziloBuser(GetPlayerVehicleID(playerid)))
{
if(BusKretanje[playerid] >= sekundaigre) return 1;
SetPlayerCheckpoint(playerid,BusLinijaCp[VoziAutobus[playerid]][0],BusLinijaCp[VoziAutobus[playerid]][1],BusLinijaCp[VoziAutobus[playerid]][2], 8.0);//
VoziAutobus[playerid]++;
new currentState = GetPlayerState(playerid);
if (currentState == PLAYER_STATE_PASSENGER)
{
DisablePlayerCheckpoint(playerid);
VoziAutobus[playerid] = 0;
TogglePlayerControllable(playerid, 0);
GameTextForPlayer(playerid,"~r~Moras biti vozac!", 5000, 1);
}
GameTextForPlayer(playerid, "~g~Nova stanica locirana", 3000, 3);
BusKretanje[playerid] = 0;
}
}
}
}
return 1;
}
pawn Код:
new Float:BusLinijaCp[104][3] = {
{2027.5176,-1939.9084,13.3362}, // Linija 1 Prva
{2311.2935,-1933.3092,13.3489},
};