/*[----------------------- Fraktionscar System -----------------------]*/
if(strcmp(cmdtext,"/fpark",true)==0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new fc;while(fc<sizeof(FactionCars))
{
if(FactionCars[fc][fVehid]<= 400&&FactionCars[fc][fVehid]<= 611);
{
if(GetPlayerVehicleID(playerid) == FactionCars[fc][fCarid])
{
if(GetPlayerAdmin(playerid) >= NEEDED_ADMINLEVEL || GetPlayerLeader(playerid) == FactionCars[fc][fFaction][0])
{
GetVehiclePos(FactionCars[fc][fCarid],FactionCars[fc][fPos][0],FactionCars[fc][fPos][1],FactionCars[fc][fPos][2]);
GetVehicleZAngle(FactionCars[fc][fCarid],FactionCars[fc][fPos][3]);
SendClientMessage(playerid,FACTION_COL_YELLOW,"Du hast das Fraktionsfahrzeug erfolgreich umgeparkt.");
}
else SendClientMessage(playerid,FACTION_COL_GREY,"Du bist dazu nicht berechtigt.");
return true;
}
}fc++;
}SendClientMessage(playerid,FACTION_COL_GREY,"Du sitzt in keinem Fraktionsfahrzeug.");
}else SendClientMessage(playerid,FACTION_COL_GREY,"Du sitzt in keinem Fahrzeug oder bist nicht der Fahrer.");
return true;
}
if(strcmp(cmdtext,"/fcarsell",true)==0){
if(GetPlayerLeader(playerid)){
if(IsAllowedFactionToBuy(GetPlayerFaction(playerid))){
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER){
new Carid1 = GetPlayerVehicleID(playerid);
for(new fc;fc<sizeof(FactionCars);fc++){
if(FactionCars[fc][fVehid] >= 400 && FactionCars[fc][fVehid] <= 611){
if(Carid1 == FactionCars[fc][fCarid]){
if(FactionCars[fc][fFaction][0] == GetPlayerLeader(playerid)){
if(FactionCars[fc][fTowed] == 1){return SendClientMessage(playerid, COLOR_GREY,"Das Fraktionsauto ist abgeschleppt");}
FactionCars[fc][fVehid] = -255;
if(DestroyVehicle(FactionCars[fc][fCarid]))
FactionCars[fc][fCarid] = -255;
new fText[178];
format(fText,sizeof(fText),"Du hast das Fraktionsfahrzeug erfolgreich für $%d(50%% vom Kaufpreis) verkauft.",(FactionCars[fc][fPrice]/2));
SendClientMessage(playerid,FACTION_COL_YELLOW,fText);
CallRemoteFunction("Script_GivePlayerMoney","id",playerid,(FactionCars[fc][fPrice]/2));
}
else SendClientMessage(playerid,FACTION_COL_GREY,"Du bist nicht der besitzer dieses Fahrzeuges.");
return true;
}
}
}SendClientMessage(playerid,FACTION_COL_GREY,"Du sitzt in keinem Fraktionsfahrzeug.");
}else SendClientMessage(playerid,FACTION_COL_GREY,"Du musst der Fahrer eines Fahrzeuges sein.");
}else SendClientMessage(playerid,FACTION_COL_GREY,"Deine Fraktion ist dazu nicht berechtigt.");
}else SendClientMessage(playerid,FACTION_COL_GREY,"Du bist nicht berechtigt diesen Befehl anzuwenden.");
return true;
}
if(strcmp(cmdtext,"/lfa",true)==0){
if(GetPlayerAdmin(playerid) >= NEEDED_ADMINLEVEL){
for(new fc;fc<sizeof(FactionCars);fc++){
if(FactionCars[fc][fVehid] >= 400 && FactionCars[fc][fVehid] <= 611){
new Float:fX,Float:fY,Float:fZ;
GetVehiclePos(FactionCars[fc][fCarid],fX,fY,fZ);
if(IsPlayerInRangeOfPoint(playerid,4.0,fX,fY,fZ)){
FactionCars[fc][fVehid] = -255;
if(DestroyVehicle(FactionCars[fc][fCarid])){
FactionCars[fc][fCarid] = -255;
}return SendClientMessage(playerid,FACTION_COL_YELLOW,"Du hast das Fraktionsfahrzeug entfernt.");
}
}
}
}else SendClientMessage(playerid,FACTION_COL_GREY,"Du bist nicht berechtigt diesen Befehl anzuwenden.");
return true;
}
if(strcmp(cmdtext,"/rafa",true)==0){
if(GetPlayerAdmin(playerid) >= NEEDED_ADMINLEVEL){
new fName[MAX_PLAYER_NAME];
GetPlayerName(playerid,fName,sizeof(fName));
format(string,sizeof(string),"Server: %s hat alle Fraktionsfahrzeuge respawnt.",fName);
SendClientMessageToAll(FACTION_COL_YELLOW,string);
for(new fc;fc<sizeof(FactionCars);fc++){
if(FactionCars[fc][fVehid] >= 400 && FactionCars[fc][fVehid] <= 611)
DestroyAndCreateFactionCar(fc);
}
}else SendClientMessage(playerid,FACTION_COL_GREY,"Du bist nicht berechtigt diesen Befehl anzuwenden.");
return true;
}
if(strcmp(cmdtext,"/ramfa",true)==0){
if(GetPlayerLeader(playerid)){
if(gettime() < LastRespawned[GetPlayerFaction(playerid)-1])
return SendClientMessage(playerid,FACTION_COL_GREY,"Du kannst deine Fahrzeuge nur alle '15' Minuten respawnen.");
LastRespawned[GetPlayerFaction(playerid)-1] = gettime()+(60*15);
for(new fc;fc<sizeof(FactionCars);fc++){
if(FactionCars[fc][fVehid] >= 400 && FactionCars[fc][fVehid] <= 611){
if(FactionCars[fc][fFaction][0] == GetPlayerFaction(playerid)){
DestroyAndCreateFactionCar(fc);
}
}
}SendClientMessage(playerid,FACTION_COL_YELLOW,"Du hast deine Fraktionsfahrzeuge erfolgreich respawnt.");
}else SendClientMessage(playerid,FACTION_COL_GREY,"Du bist nicht berechtigt diesen Befehl anzuwenden.");
return true;
}
#if defined FACTION_CARS_LOCKABLE
if(strcmp(cmdtext,"/flock",true)==0){
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER){
for(new fc;fc<sizeof(FactionCars);fc++){
if(FactionCars[fc][fVehid] >= 400 && FactionCars[fc][fVehid] <= 611){
if(GetPlayerVehicleID(playerid) == FactionCars[fc][fCarid]){
for(new f;f<5;f++){
if(GetPlayerAdmin(playerid) >= NEEDED_ADMINLEVEL || GetPlayerFaction(playerid) == FactionCars[fc][fFaction][f]){
PlayerPlaySound(playerid,1145,0.0,0.0,0.0);
if(FactionCars[fc][fLock] == true){
FactionCars[fc][fLock] = false;
fUnlockCar(FactionCars[fc][fCarid]);
GameTextForPlayer(playerid,"~w~Fahrzeug~n~~g~Aufgeschlossen",5000,3);
}
else if(FactionCars[fc][fLock] == false){
fLockCar(FactionCars[fc][fCarid]);
FactionCars[fc][fLock] = true;
GameTextForPlayer(playerid,"~w~Fahrzeug~n~~r~Abgeschlossen",5000,3);
}break;
}
}return true;
}
}
}SendClientMessage(playerid,FACTION_COL_GREY,"Du sitzt in keinem Fraktionsfahrzeug!");
}else{
if(GetPlayerState(playerid)==PLAYER_STATE_PASSENGER)
SendClientMessage(playerid,FACTION_COL_GREY,"Du musst der Fahrer dieses Fahrzeuges sein.");
else
SendClientMessage(playerid,FACTION_COL_GREY,"Du muss in einem Fahrzeug sitzen.");
}return true;
}
#endif
Das ist das was ich eingefügt habe