Hallo,
wenn ich in ein Fahrzeug einsteige, steige ich automatisch wieder aus (dies ist nur bei mir so)...
was kann das sein und wie kann ich es beheben?
/edit: Außerdem können alle Personen Fahrzeuge wie Müllautos (MuellCar) fahren
Der Server sagt nur das:
OnPlayerStateChange:
Code
public OnPlayerStateChange(playerid, newstate, oldstate)
{
M_OnPlayerStateChange(playerid, newstate, oldstate);
new string[256];
if(newstate == PLAYER_STATE_ONFOOT)
{
if(PlayerKarting[playerid] > 0 && PlayerInKart[playerid] > 0)
{
PlayerInKart[playerid] = 0;
KartingPlayers --;
}
if(TransportDuty[playerid] > 0)
{
if(TransportDuty[playerid] == 1)
{
TaxiDrivers -= 1;
}
else if(TransportDuty[playerid] == 2)
{
BusDrivers -= 1;
}
TransportDuty[playerid] = 0;
format(string, sizeof(string), "* Nun bist du nicht mehr im Dienst, du hast $%d verdient.", TransportMoney[playerid]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GivePlayerMoney(playerid, TransportMoney[playerid]);
ConsumingMoney[playerid] = 1; TransportValue[playerid] = 0; TransportMoney[playerid] = 0;
}
if(TransportCost[playerid] > 0 && TransportDriver[playerid] < 999)
{
if(IsPlayerConnected(TransportDriver[playerid]))
{
TransportMoney[TransportDriver[playerid]] += TransportCost[playerid];
TransportTime[TransportDriver[playerid]] = 0;
TransportCost[TransportDriver[playerid]] = 0;
format(string, sizeof(string), "~w~Der Transport kostet~n~~r~$%d",TransportCost[playerid]);
GameTextForPlayer(playerid, string, 5000, 1);
format(string, sizeof(string), "~w~Der Kunde verlässt das Fahrzeug~n~~g~Du bekommst $%d",TransportCost[playerid]);
GameTextForPlayer(TransportDriver[playerid], string, 5000, 1);
GivePlayerMoney(playerid, -TransportCost[playerid]);
TransportCost[playerid] = 0;
TransportTime[playerid] = 0;
TransportDriver[playerid] = 999;
}
}
TelePos[playerid][0] = 0.0;
TelePos[playerid][1] = 0.0;
}
if(newstate == PLAYER_STATE_PASSENGER) // TAXI & BUSSES
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 437 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 431)
{
GivePlayerMoney(playerid,-5);
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Sie bezahlen $5 für ein Ticket.");
}
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new vehicleid = GetPlayerVehicleID(playerid);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == 2 && TransportDuty[i] > 0)
{
if(GetPlayerMoney(playerid) < TransportValue[i])
{
format(string, sizeof(string), "* Du brauchst $%d, um einsteigen zu können.", TransportValue[i]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
RemovePlayerFromVehicle(playerid);
}
else
{
if(TransportDuty[i] == 1)
{
format(string, sizeof(string), "* Du bezahlst $%d, dem Taxifahrer.", TransportValue[i]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Kunde %s betritt dein Taxi.", name);
SendClientMessage(i, COLOR_LIGHTBLUE, string);
TransportTime[i] = 1;
TransportTime[playerid] = 1;
TransportCost[playerid] = TransportValue[i];
TransportCost[i] = TransportValue[i];
TransportDriver[playerid] = i;
}
GivePlayerMoney(playerid, - TransportValue[i]);
TransportMoney[i] += TransportValue[i];
}
}
}
}
}
if(newstate == PLAYER_STATE_WASTED)
{
if(WantedLevel[playerid] >= 1)
{
new price = WantedLevel[playerid] * 5000;
new count;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsACop(i) && CrimInRange(30.0, playerid,i))
{
count = 1;
format(string, sizeof(string), "~w~Verbrecher gestorben~g~$1000", price);
GameTextForPlayer(i, string, 5000, 1);
ConsumingMoney[i] = 1;
GivePlayerMoney(i, 1000);
PlayerPlaySound(i, 1058, 0.0, 0.0, 0.0);
}
}
}
if(count == 1)
{
GivePlayerMoney(playerid, - price);
PlayerInfo[playerid][pWantedDeaths] += 1;
PlayerInfo[playerid][pJailed] = 1;
PlayerInfo[playerid][pJailTime] = (WantedLevel[playerid] * 400);
format(string, sizeof(string), "Sie sind für %d Sekunden im Gefängnis und müssen $%d bezahlen.", PlayerInfo[playerid][pJailTime], price);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
WantedPoints[playerid] = 0;
WantedLevel[playerid] = 0;
PlayerInfo[playerid][WantedTot]=1;
SetPlayerHealth(playerid,100);
PlayerInfo[playerid][pTot]=0;
}
}
}
/*if(oldstate == PLAYER_STATE_DRIVER && MotorschadenMSGSent[playerid] == 2)
{
UnFreezePlayer(playerid);
MotorschadenMSGSent[playerid] = 0;
}*/
if(newstate == PLAYER_STATE_DRIVER) //buggy dont finnish
{// 38 / 49 / 56 = SS
new newcar = GetPlayerVehicleID(playerid);
new oldcar = gLastCar[playerid];
new housecar = PlayerInfo[playerid][pPhousekey]+1;
TelePos[playerid][0] = 0.0;
TelePos[playerid][1] = 0.0;
if(ADuty[playerid] == 0)
{
if(IsABoat(newcar))
{
if(PlayerInfo[playerid][pBoatLic] < 1)
{
SendClientMessage(playerid, COLOR_GREY, " Du hast kein Bootschein");
RemovePlayerFromVehicle(playerid);
}
}
else if(IsAPlane(newcar))
{
if(PlayerInfo[playerid][pFlyLic] < 1)
{
if(TakingLesson[playerid] == 1) { }
else
{
SendClientMessage(playerid, COLOR_GREY, " Du hast keinen Flugschein !");
RemovePlayerFromVehicle(playerid);
}
}
}
if(IsAnAmbulance(newcar))
{
if(PlayerInfo[playerid][pMember] == 4||PlayerInfo[playerid][pLeader] == 4 || PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pLeader] == 7)
{
if(JobDuty[playerid] == 1)
{
}
else
{
SendClientMessage(playerid, 0xAA3333AA, "Sie sind nicht im Dienst.");
RemovePlayerFromVehicle(playerid);
}
}
else
{
SendClientMessage(playerid, 0xAA3333AA, "Sie haben keinen Schlüssel.");
RemovePlayerFromVehicle(playerid);
}
}
else if(IsACopCar(newcar))
{
if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 7 || PlayerInfo[playerid][pMember] == 7)
{
if(OnDuty[playerid] == 1)
{
}
else
{
SendClientMessage(playerid, 0xAA3333AA, "Sie sind nicht im Dienst.");
RemovePlayerFromVehicle(playerid);
}
}
else
{
SendClientMessage(playerid, 0xAA3333AA, "Sie haben keinen Schlüssel.");
RemovePlayerFromVehicle(playerid);
}
}
else if(IsABbzCar(newcar))
{
if(PlayerInfo[playerid][pLeader] == 19 || PlayerInfo[playerid][pMember] == 19)
{
}
else
{
SendClientMessage(playerid, 0xAA3333AA, "Sie haben keinen Schlüssel.");
RemovePlayerFromVehicle(playerid);
}
}
else if(IsAaCar(newcar))
{
}
if(IsAfbicar(newcar))
{
if(PlayerInfo[playerid][pMember] == 2||PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pLeader] == 7)
{
if(OnDuty[playerid] == 1)
{
}
else
{
SendClientMessage(playerid, 0xAA3333AA, "Sie sind nicht im Dienst.");
RemovePlayerFromVehicle(playerid);
}
}
else
{
SendClientMessage(playerid, 0xAA3333AA, "Sie haben keinen Schlüssel.");
RemovePlayerFromVehicle(playerid);
}
}
if(IsABloodzCar(newcar))
{
if(PlayerInfo[playerid][pMember] == 18||PlayerInfo[playerid][pLeader] == 18) { }
else
{
SendClientMessage(playerid, 0xAA3333AA, "Sie haben keinen Schlüssel.");
RemovePlayerFromVehicle(playerid);
}
}
if(IsANewsCar(newcar))
{
if(PlayerInfo[playerid][pMember] == 9||PlayerInfo[playerid][pLeader] == 9) { }
else
{
SendClientMessage(playerid, 0xAA3333AA, "Sie haben keinen Schlüssel.");
RemovePlayerFromVehicle(playerid);
}
}
if(IsAAdminCar(newcar))
{
if (PlayerInfo[playerid][pAdmin] >= 1) { }
else
{
SendClientMessage(playerid, 0xAA3333AA, "Sie haben keinen Schlüssel.");
RemovePlayerFromVehicle(playerid);
}
}
if(IsAHitmanCar(newcar))
{
if(PlayerInfo[playerid][pMember] == 8||PlayerInfo[playerid][pLeader] == 8) { }
else
{
SendClientMessage(playerid, 0xAA3333AA, "Sie haben keinen Schlüssel.");
RemovePlayerFromVehicle(playerid);
}
}
if(IsASwatCar(newcar))
{
if(PlayerInfo[playerid][pMember] == 16||PlayerInfo[playerid][pLeader] == 16 || PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pLeader] == 7)
{
if(OnDuty[playerid] == 1)
{
}
else
{
SendClientMessage(playerid, 0xAA3333AA, "Sie sind nicht im Dienst.");
RemovePlayerFromVehicle(playerid);
}
}
else
{
SendClientMessage(playerid, 0xAA3333AA, "Sie haben keinen Schlüssel.");
RemovePlayerFromVehicle(playerid);
}
}
if(IsAYakuCar(newcar))
{
if(PlayerInfo[playerid][pMember] == 6||PlayerInfo[playerid][pLeader] == 6) { }
else
{
SendClientMessage(playerid, 0xAA3333AA, "Sie haben keinen Schlüssel.");
RemovePlayerFromVehicle(playerid);
}
}
if(IsAArmyCar(newcar))
{
if(PlayerInfo[playerid][pMember] == 3||PlayerInfo[playerid][pLeader] == 3 || PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pLeader] == 7)
{
if(OnDuty[playerid] == 1)
{
}
else
{
SendClientMessage(playerid, 0xAA3333AA, "Sie sind nicht im Dienst.");
RemovePlayerFromVehicle(playerid);
}
}
else
{
SendClientMessage(playerid, 0xAA3333AA, "Sie haben keinen Schlüssel.");
RemovePlayerFromVehicle(playerid);
}
}
if(IsALcnCar(newcar))
{
if(PlayerInfo[playerid][pMember] == 5||PlayerInfo[playerid][pLeader] == 5) { }
else
{
SendClientMessage(playerid, 0xAA3333AA, "Sie haben keinen Schlüssel.");
RemovePlayerFromVehicle(playerid);
}
}
if(IsARegierungCar(newcar))
{
if(PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pLeader] == 7)
{
if(OnDuty[playerid] == 1)
{
}
else
{
SendClientMessage(playerid, 0xAA3333AA, "Sie sind nicht im Dienst.");
RemovePlayerFromVehicle(playerid);
}
}
else
{
SendClientMessage(playerid, 0xAA3333AA, "Sie haben keinen Schlüssel.");
RemovePlayerFromVehicle(playerid);
}
}
if(IsATaxiCar(newcar))
{
if(PlayerInfo[playerid][pMember] == 10 || PlayerInfo[playerid][pLeader] == 10) { }
else
{
SendClientMessage(playerid, 0xAA3333AA, "Sie haben keinen Schlüssel.");
RemovePlayerFromVehicle(playerid);
}
}
if(IsAGrooveCar(newcar))
{
if(PlayerInfo[playerid][pMember] == 12||PlayerInfo[playerid][pLeader] == 12) { }
else
{
SendClientMessage(playerid, 0xAA3333AA, "Sie haben keinen Schlüssel.");
RemovePlayerFromVehicle(playerid);
}
}
if(IsACripscar(newcar))
{
if(PlayerInfo[playerid][pMember] == 13||PlayerInfo[playerid][pLeader] == 13) { }
else
{
SendClientMessage(playerid, 0xAA3333AA, "Sie haben keinen Schlüssel.");
RemovePlayerFromVehicle(playerid);
}
}
if(IsAVagosCar(newcar))
{
if(PlayerInfo[playerid][pMember] == 14||PlayerInfo[playerid][pLeader] == 14) { }
else
{
SendClientMessage(playerid, 0xAA3333AA, "Sie haben keinen Schlüssel.");
RemovePlayerFromVehicle(playerid);
}
}
if(IsAAtzecaCar(newcar))
{
if(PlayerInfo[playerid][pMember] == 15||PlayerInfo[playerid][pLeader] == 15) { }
else
{
SendClientMessage(playerid, 0xAA3333AA, "Sie haben keinen Schlüssel.");
RemovePlayerFromVehicle(playerid);
}
}
if(IsAFeuerCar(newcar))
{
if(PlayerInfo[playerid][pJob] != 10 || JobDuty[playerid] != 1)
{
SendClientMessage(playerid, 0xAA3333AA, "Sie haben keinen Schlüssel.");
RemovePlayerFromVehicle(playerid);
}
}
if(IsAMechaCar(newcar))
{
if(PlayerInfo[playerid][pJob] != 7 || JobDuty[playerid] != 1)
{
SendClientMessage(playerid, 0xAA3333AA, "Sie haben keinen Schlüssel.");
RemovePlayerFromVehicle(playerid);
}
}
if(IsAMuellCar(newcar))
{
if(PlayerInfo[playerid][pJob] != 17 || JobDuty[playerid] != 1)
{
SendClientMessage(playerid, 0xAA3333AA, "Sie haben keinen Schlüssel.");
RemovePlayerFromVehicle(playerid);
}
}
if(IsABusCar(newcar))
{
if(PlayerInfo[playerid][pJob] != 14)
{
SendClientMessage(playerid, 0xAA3333AA, "Sie haben keinen Schlüssel.");
RemovePlayerFromVehicle(playerid);
}
}
if(IsAZugCar(newcar))
{
if(PlayerInfo[playerid][pJob] != 2)
{
SendClientMessage(playerid, 0xAA3333AA, "Sie haben keinen Schlüssel.");
RemovePlayerFromVehicle(playerid);
}
}
/*if(IsAMietCar(newcar))
{
if(PlayerInfo[playerid][Mieten]==0)
{
TogglePlayerControllable(playerid,0);
SendClientMessage(playerid,COLOR_DBLUE,"______________ Autoverleih ______________");
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Um diese Fahrzeug zu mieten /automieten");
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Um es zu verlassen /exit");
SendClientMessage(playerid,COLOR_DBLUE,"_________________________________________");
}
}*/
if(IsASweepCar(newcar))
{
if(PlayerInfo[playerid][pJob] != 15)
{
SendClientMessage(playerid, 0xAA3333AA, "Sie haben keinen Schlüssel.");
RemovePlayerFromVehicle(playerid);
}
}
if(IsAFahrCar(newcar))
{
if(TakingLesson[playerid] == 1) { }
else if(!IsAnInstructor(playerid))
{
SendClientMessage(playerid, 0xAA3333AA, "Sie haben keinen Schlüssel.");
RemovePlayerFromVehicle(playerid);
}
}
if(IsASEKCar(newcar))
{
if(IsACop(playerid))
{
if(PlayerInfo[playerid][SEKDuty] == 1)
{
}
else
{
SendClientMessage(playerid, 0xAA3333AA, "Sie sind nicht im Dienst.");
RemovePlayerFromVehicle(playerid);
}
}
else
{
SendClientMessage(playerid, 0xAA3333AA, "Sie haben keinen Schlüssel.");
RemovePlayerFromVehicle(playerid);
}
}
if(oldcar != 301)
{
if((housecar != oldcar && oldcar != 0) && (HireCar[playerid] != oldcar && newcar != housecar))
{
if(gLastDriver[oldcar] == playerid && oldcar != newcar)
{
gLastDriver[oldcar] = 300;
gCarLock[oldcar] = 0;
UnLockCar(oldcar);
}
}
}
gLastCar[playerid] = newcar;
gLastDriver[newcar] = playerid;
}
if(newstate == PLAYER_STATE_SPAWNED)
{
new Float: lwx, Float:lwy, Float:lwz;
GetPlayerPos(playerid, lwx, lwy, lwz);
if((lwz > 530.0 && PlayerInfo[playerid][pInt] == 0) || IsPlayerInRangeOfPoint(playerid,1000.0, -1041.9,-1868.4,79.1)) //the highest land point in sa = 526.8
{
SetPlayerSpawn(playerid);
}
/*if(WantedPoints[playerid] > 0)
{
new dstring[128];
new wanted = WantedPoints[playerid];
new diecash = 0;
while(WantedPoints[playerid] > 0)
{
diecash += 500;
WantedPoints[playerid] --;
}
format(dstring, sizeof(dstring), "Du Verlierst $%d für Sterben mit %d Wanteds.", diecash, wanted);
SendClientMessage(playerid, COLOR_YELLOW, dstring);
GivePlayerMoney(playerid, - diecash);
PlayerInfo[playerid][pWantedDeaths] += 1;
}*/
//WantedPoints[playerid] = 0;
//WantedLevel[playerid] = 0;
if(PlayerInfo[playerid][pDonateRank] > 0) { SetPlayerHealth(playerid, 100.0); }
else { SetPlayerHealth(playerid, 50.0+PlayerInfo[playerid][pSHealth]); }
MedicBill[playerid] = 1;
TelePos[playerid][0] = 0.0;
TelePos[playerid][1] = 0.0;
gPlayerSpawned[playerid] = 1;
SafeTime[playerid] = 60;
}
else if(ADuty[playerid] == 1)
{
new aveh = GetPlayerVehicleID(playerid);
SendClientMessage(playerid, 0xAA3333AA, "Du darfst dieses Fahrzeug im Admin-Dienst fahren!");
EngineStatus[aveh] = 1;
gGas[playerid] = 1;
}
return 1;
}
return 1;
}
Alles anzeigen