forward LoadDrivingTestPosition();
forward SaveDrivingTestPosition();
new TakingDrivingTest[MAX_PLAYERS];
new DrivingTestStep[MAX_PLAYERS];
new DrivingTestPosition[DrivingTestLocation];
enum DrivingTestLocation
{
Float:X,
Float:Y,
Float:Z,
World,
Interior,
Float:Angle,
PickupID,
};
public LoadScript()
{
LoadDrivingTestPosition();
public ResetStats(playerid)
{
TakingDrivingTest[playerid] = 0;
DrivingTestStep[playerid] = 0;
if(strcmp(cmd, "/Führerschein", true) == 0)
{
if(PlayerToPoint(1.0,playerid,DrivingTestPosition[X],DrivingTestPosition[Y],DrivingTestPosition[Z]))
{
if(PlayerInfo[playerid][pCarLic] == 0)
{
if(GetPlayerCash(playerid) >= 3500)
{
GivePlayerCash(playerid,-3500);
SendClientMessage(playerid,COLOR_WHITE,"[Info:] Fahrstunde gestartet, Geh raus ums eck und nimm dir ein Fahrschulauto");
TakingDrivingTest[playerid] = 1;
}
else
{
SendClientMessage(playerid,COLOR_GREY,"[Error:] Du hast nicht genug Geld");
}
}
else
{
SendClientMessage(playerid,COLOR_GREY,"[Error:] Du hast schon einen Führerschein");
}
}
else
{
SendClientMessage(playerid,COLOR_GREY,"[Error:] Du bist nicht in der Fahrschule");
}
return 1;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{ if(TakingDrivingTest[playerid] != 1)
{
new Float:playerposx, Float:playerposy, Float:playerposz;
GetPlayerPos(playerid, playerposx, playerposy, playerposz);
if(PlayerInfo[playerid][pAdmin] == 0)
{
SetPlayerPos(playerid,playerposx, playerposy, playerposz);
}
SendClientMessage(playerid,COLOR_GREY,"[Info:] Du machst keinen Führerschein");
}
}
public OnPlayerStateChange(playerid, newstate, oldstate)
if(TakingDrivingTest[playerid] == 1)
{
SendClientMessage(playerid,COLOR_WHITE,"[Info:] Fahre die Checkpoints ab (20% Schaden Max)");
if(DrivingTestStep[playerid] == 0)
{
SetPlayerCheckpoint(playerid, 1328.8065,-1403.0996,13.2369, 5.0);
DrivingTestStep[playerid] = 1;
}
}
else
{
RemoveDriverFromVehicle(playerid);
}
}
Hier ein Bisschen mehr von Code der server crasht immer wenn ich in ein prüfungsauto steige
Edit: Hat sich erledigt habs selbst geschafft