Hallo wie baue ich im folgenden Code ein das nur Fraktionsmitglieder den Motor Starten können
Code
COMMAND:motor(playerid,params[])
{
if(ImTutorial[playerid] != 0)return SendClientMessage(playerid,SAMP_ROT,""ACCINFO"Du hast keine erlaubnis diesen Befehl benutzen zu drüfen.");
if(GetPVarInt(playerid,"Eingeloggt") == 0)return SendClientMessage(playerid,SAMP_WEISS,""ACCINFO"Du bist nicht eingeloggt!");
if(Spieler[playerid][pAWAYFROMKEYBOARD] == 1)return SendClientMessage(playerid,SAMP_WEISS,"Du bist im AFK-Modus und kannst somit keine Befehle nutzen."),SendClientMessage(playerid,SAMP_WEISS,""#HTML_BLAU"Verwendung:"#HTML_WEISS" /back");
if(Spieler[playerid][pInPrison] == 1)return SendClientMessage(playerid,SAMP_WEISS,"Du bist im Prison.");
new vehicleid = GetPlayerVehicleID(playerid),string[128];
if(Spieler[playerid][pFriedhof] == 1)return SendClientMessage(playerid,SAMP_WEISS,"Du bist nicht in der Lage zu schrieben.");
if(Spieler[playerid][pDeath] == 1)return SendClientMessage(playerid,SAMP_WEISS,"Du bist verletzt.");
if(!IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid,SAMP_WEISS,"Du sitzt in keinem Fahrzeug.");
if(GetPlayerVehicleSeat(playerid) != 0)return SendClientMessage(playerid,SAMP_WEISS,"Nicht der Fahrer des Fahrzeugs.");
if(Spieler[playerid][pHealTime] != 0)return SendClientMessage(playerid,SAMP_WEISS,"Du kannst während des Geschlechtsverkehr den Motor des Fahrzeuges nicht starten.");
if(RepairAVehicle[vehicleid] == 1)return SendClientMessage(playerid,SAMP_WEISS,"Dein Fahrzeug wird gerade repariert!");
if(RefillVehicle[vehicleid] == 1)return SendClientMessage(playerid,SAMP_WEISS,"Du tankst gerade!");
if(vFahrzeug[vehicleid][Handbremse] == 1)return SendClientMessage(playerid,SAMP_WEISS,"Bitte löse zu erst die Handbremse!");
if(GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 510)return SendClientMessage(playerid,SAMP_WEISS,"Das Fahrzeug hat keinen Motor.");
else if(MotorDown[vehicleid] != 0)return SendClientMessage(playerid,WEISS,"Das Fahrzeug ist kaputt. Rufe einen Abschlepper oder einen Kraftfahrzeugmechaniker.");
else if(vFahrzeug[vehicleid][Tank] <= 0.0)return SendClientMessage(playerid,SAMP_WEISS,"Tank leer.");
else if(Motor[vehicleid] == false)
{
if(vFahrzeug[vehicleid][Carbomb] != 1)
{
Motor[vehicleid] = true;
KillTimer(vFahrzeug[vehicleid][VehicleEngineTimer]);
vFahrzeug[vehicleid][VehicleEngineTimer] = SetTimerEx("VehicleEngine",VehicleInfo[GetVehicleModel(vehicleid)-400][vEngineStartInSek]*1000,0,"ii",playerid,vehicleid);
GameTextForPlayer(playerid,"~w~Motor~g~ wird gestartet",VehicleInfo[GetVehicleModel(vehicleid)-400][vEngineStartInSek]*1000,6);
}
else
{
RemovePlayerFromVehicle(playerid);
SetPlayerHealth(playerid, 0);
vFahrzeug[vehicleid][Carbomb] = 0;
new randompos = random(20),randexploderadius = random(40)+10;
new Float:vehx, Float:vehy, Float:vehz;
GetVehiclePos(vehicleid,vehx,vehy,vehz);
CreateExplosion(vehx+randompos,vehy+randompos,vehz+randompos,7,randexploderadius);
AddFire(vehx+randompos,vehy+randompos,vehz+randompos,GetPlayerVirtualWorld(playerid),true);
randexploderadius = random(30)+10;
randompos = random(10);
CreateExplosion(vehx+randompos,vehy+randompos,vehz+randompos,7,randexploderadius);
AddFire(vehx+randompos,vehy+randompos,vehz+randompos,GetPlayerVirtualWorld(playerid),false);
randexploderadius = random(30)+10;
randompos = random(10);
CreateExplosion(vehx+randompos,vehy+randompos,vehz+randompos,7,randexploderadius);
AddFire(vehx+randompos,vehy+randompos,vehz+randompos,GetPlayerVirtualWorld(playerid),false);
randexploderadius = random(30)+10;
randompos = random(10);
CreateExplosion(vehx+randompos,vehy+randompos,vehz+randompos,7,randexploderadius);
AddFire(vehx+randompos,vehy+randompos,vehz+randompos,GetPlayerVirtualWorld(playerid),false);
randexploderadius = random(30)+10;
randompos = random(10);
CreateExplosion(vehx+randompos,vehy+randompos,vehz+randompos,7,randexploderadius);
AddFire(vehx+randompos,vehy+randompos,vehz+randompos,GetPlayerVirtualWorld(playerid),false);
randexploderadius = random(30)+10;
randompos = random(10);
CreateExplosion(vehx+randompos,vehy+randompos,vehz+randompos,7,randexploderadius);
AddFire(vehx+randompos,vehy+randompos,vehz+randompos,GetPlayerVirtualWorld(playerid),false);
randexploderadius = random(30)+10;
randompos = random(10);
CreateExplosion(vehx+randompos,vehy+randompos,vehz+randompos,7,randexploderadius);
AddFire(vehx+randompos,vehy+randompos,vehz+randompos,GetPlayerVirtualWorld(playerid),false);
randexploderadius = random(30)+10;
randompos = random(10);
CreateExplosion(vehx+randompos,vehy+randompos,vehz+randompos,7,randexploderadius);
AddFire(vehx+randompos,vehy+randompos,vehz+randompos,GetPlayerVirtualWorld(playerid),false);
randexploderadius = random(30)+10;
randompos = random(10);
CreateExplosion(vehx+randompos,vehy+randompos,vehz+randompos,7,randexploderadius);
AddFire(vehx+randompos,vehy+randompos,vehz+randompos,GetPlayerVirtualWorld(playerid),false);
randexploderadius = random(30)+10;
randompos = random(10);
CreateExplosion(vehx+randompos,vehy+randompos,vehz+randompos,7,randexploderadius);
AddFire(vehx+randompos,vehy+randompos,vehz+randompos,GetPlayerVirtualWorld(playerid),false);
randexploderadius = random(30)+10;
randompos = random(10);
ForEachPlayer(i)
{
if(IsPlayerConnected(i) && !IsPlayerNPC(i))
{
if(isPlayerInFrakt(i,8))
{
format(string,sizeof(string),"Detonation: Eine in einem/r %s verbaute Autobombe ist detoniert.",VehicleDefinations[GetVehicleModel(vehicleid)-400]);
SendClientMessage(i,GELB,string);
}
}
}
return 1;
}
}
else if(Motor[vehicleid] == true)
{
if(vFahrzeug[vehicleid][Carbomb] != 1)
{
KillTimer(vFahrzeug[vehicleid][VehicleEngineTimer]);
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
Motor[vehicleid] = false;
GameTextForPlayer(playerid,"~w~Motor ~r~ausgeschaltet",2000,6);
}
else
{
RemovePlayerFromVehicle(playerid);
SetPlayerHealth(playerid, 0);
vFahrzeug[vehicleid][Carbomb] = 0;
new randompos = random(20),randexploderadius = random(40)+10;
new Float:vehx, Float:vehy, Float:vehz;
GetVehiclePos(vehicleid,vehx,vehy,vehz);
CreateExplosion(vehx+randompos,vehy+randompos,vehz+randompos,7,randexploderadius);
AddFire(vehx+randompos,vehy+randompos,vehz+randompos,GetPlayerVirtualWorld(playerid),true);
randexploderadius = random(30)+10;
randompos = random(10);
CreateExplosion(vehx+randompos,vehy+randompos,vehz+randompos,7,randexploderadius);
AddFire(vehx+randompos,vehy+randompos,vehz+randompos,GetPlayerVirtualWorld(playerid),false);
randexploderadius = random(30)+10;
randompos = random(10);
CreateExplosion(vehx+randompos,vehy+randompos,vehz+randompos,7,randexploderadius);
AddFire(vehx+randompos,vehy+randompos,vehz+randompos,GetPlayerVirtualWorld(playerid),false);
randexploderadius = random(30)+10;
randompos = random(10);
CreateExplosion(vehx+randompos,vehy+randompos,vehz+randompos,7,randexploderadius);
AddFire(vehx+randompos,vehy+randompos,vehz+randompos,GetPlayerVirtualWorld(playerid),false);
randexploderadius = random(30)+10;
randompos = random(10);
CreateExplosion(vehx+randompos,vehy+randompos,vehz+randompos,7,randexploderadius);
AddFire(vehx+randompos,vehy+randompos,vehz+randompos,GetPlayerVirtualWorld(playerid),false);
randexploderadius = random(30)+10;
randompos = random(10);
CreateExplosion(vehx+randompos,vehy+randompos,vehz+randompos,7,randexploderadius);
AddFire(vehx+randompos,vehy+randompos,vehz+randompos,GetPlayerVirtualWorld(playerid),false);
randexploderadius = random(30)+10;
randompos = random(10);
CreateExplosion(vehx+randompos,vehy+randompos,vehz+randompos,7,randexploderadius);
AddFire(vehx+randompos,vehy+randompos,vehz+randompos,GetPlayerVirtualWorld(playerid),false);
randexploderadius = random(30)+10;
randompos = random(10);
CreateExplosion(vehx+randompos,vehy+randompos,vehz+randompos,7,randexploderadius);
AddFire(vehx+randompos,vehy+randompos,vehz+randompos,GetPlayerVirtualWorld(playerid),false);
randexploderadius = random(30)+10;
randompos = random(10);
CreateExplosion(vehx+randompos,vehy+randompos,vehz+randompos,7,randexploderadius);
AddFire(vehx+randompos,vehy+randompos,vehz+randompos,GetPlayerVirtualWorld(playerid),false);
randexploderadius = random(30)+10;
randompos = random(10);
CreateExplosion(vehx+randompos,vehy+randompos,vehz+randompos,7,randexploderadius);
AddFire(vehx+randompos,vehy+randompos,vehz+randompos,GetPlayerVirtualWorld(playerid),false);
randexploderadius = random(30)+10;
randompos = random(10);
ForEachPlayer(i)
{
if(IsPlayerConnected(i) && !IsPlayerNPC(i))
{
if(isPlayerInFrakt(i,8))
{
format(string,sizeof(string),"Detonation: Eine in einem/r %s verbaute Autobombe ist detoniert.",VehicleDefinations[GetVehicleModel(vehicleid)-400]);
SendClientMessage(i,GELB,string);
}
}
}
return 1;
}
}
return 1;
}
Alles anzeigen
Ich weiß nicht ich hab mich total vertan und wollte jetzt keine Scheiße machen