Hay leute
allso ich habe ein Befehl /ablassen für den oamt geschrieben aber i wie funkt das nicht in game aber abschleppen funkt
if(!strcmp(cmdtext, "/ablassen", true))
{
if(IsPlayerInDynamicArea(playerid, Abschlepphof) && GetPVarInt(playerid, "Towing") == 1 && IsPlayerInAnyVehicle(playerid) && GetVehicleTrailer(GetPlayerVehicleID(playerid)) == GetPVarInt(playerid, "TowingCar") && GetVehicleFrak(GetPlayerVehicleID(playerid)) == 24)
{
for(new i = 0; i<MAX_VEHICLES; i++)
{
if(GetVehicleTrailer(GetPlayerVehicleID(playerid)) == PlayerCar[i][vid])
{
GetVehiclePos(PlayerCar[i][vid], PlayerCar[i][px], PlayerCar[i][py], PlayerCar[i][pz]);
GetVehicleZAngle(PlayerCar[i][vid], PlayerCar[i][pa]);
DestroyVehicle(PlayerCar[i][vid]);
PlayerCar[i][vid] = CreateVehicle(PlayerCar[i][model], PlayerCar[i][px], PlayerCar[i][py], PlayerCar[i][pz], PlayerCar[i][pa], PlayerCar[i][c1], PlayerCar[i][c2], -1);
DetachTrailerFromVehicle(GetPlayerVehicleID(playerid));
if(!PlayerCar[i][JobCar] && !PlayerCar[i][FrakCar])
{
new str[60];
format(str, sizeof str, "/Accounts/%s.acc", PlayerCar[i][Key]);
if(INI_Open(str))
{
INI_WriteInt("CarTowed", 1);
INI_Save();
INI_Close();
}
}
PlayerCar[i][Towed] = 1; printf("PlayerCar[i][Towed]: %d", PlayerCar[i][Towed]);
DeletePVar(playerid, "Towing");
DeletePVar(playerid, "TowingCar");
SendClientMessage(playerid, Grey, "Car erfolgreich abgeschleppt!");
SendClientMessage(playerid, Grey, "Du kannst in das Fahrzeug einsteigen und es per /umparken parken!");
GivePlayerMoney(playerid, 1000);
return 1;
}
}
}
return 1;
}
mfg
Be_Go