Also ich habe hier ein rentbike script, aber wenn man z.B /help eingibt steht da du bist in keinem Auto bzw. Fahrrad. wenn man im auto bzw. fahrrad sitzt und /help eingibt mietet man das. Kann mir einer bitt helfen.
#include <a_samp>
#define COLOR_GREEN 0x00CA00FF
#define COLOR_RED 0xAA3333AA
#define FILTERSCRIPT
new renttimer;
new mietauto;
new BMX1;
new BMX2;
new BMX3;
new BMX4;
new BMX5;
new BMX6;
forward rentcar(playerid);
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Rent-System");
print("--------------------------------------\n");
BMX1 = AddStaticVehicle(481,1968.0056,-2184.0640,13.0633,94.0481,12,9); //
BMX2 = AddStaticVehicle(481,1967.8961,-2184.8000,13.0623,90.0863,65,9); //
BMX3 = AddStaticVehicle(481,1967.8596,-2185.5457,13.0620,90.9396,6,6); //
BMX4 = AddStaticVehicle(481,1967.7766,-2186.3176,13.0628,91.6745,1,1); //
BMX5 = AddStaticVehicle(481,1967.6813,-2187.0408,13.0609,91.4167,14,1);
BMX6 = AddStaticVehicle(481,1967.9412,-2187.8538,13.0627,95.2967,46,46);
return 1;
}
public OnFilterScriptExit()
{
SetVehicleToRespawn(BMX1);
SetVehicleToRespawn(BMX2);
SetVehicleToRespawn(BMX3);
SetVehicleToRespawn(BMX4);
SetVehicleToRespawn(BMX5);
SetVehicleToRespawn(BMX6);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/rentcar", cmdtext, true, 0) == 0)
{
new Vehicle = GetPlayerVehicleID(playerid);
if(Vehicle == BMX1 || Vehicle == BMX2 || Vehicle == BMX3 || Vehicle == BMX4 || Vehicle == BMX5 || Vehicle == BMX6){
GivePlayerMoney(playerid,-25);
TogglePlayerControllable(playerid, 1);
mietauto = Vehicle;
renttimer = SetTimer("rentcar",15000,false);
SendClientMessage(playerid,COLOR_GREEN,"Du hast dieses Auto erfolgreich gemietet.");
}else{
SendClientMessage(playerid,COLOR_GREEN,"Du bist in keinem Mietauto");
}
return 1;
}
return 0;
}
public rentcar(playerid)
{
if(IsPlayerInAnyVehicle(playerid) == true){
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid,COLOR_RED,"Deine Mietzeit ist vorbei.");
SetVehicleToRespawn(mietauto);
KillTimer(renttimer);
}
return 0;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
new mieten[128];
new Vehicle = GetPlayerVehicleID(playerid);
if(Vehicle == BMX1 || Vehicle == BMX2 || Vehicle == BMX3 || Vehicle == BMX4 || Vehicle == BMX5 || Vehicle == BMX6){
TogglePlayerControllable(playerid, 0);
SendClientMessage(playerid,COLOR_GREEN,"Du kannst dieses Auto mit /rentcar mieten.");
}
}
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
und kann mir einer ein /exit befehl geben wenn man auf fahrrad sitzt, dass man austeigt pls