Hi Leute, ich brauche Hilfe mit meinem Derby script, undzwar folgendes. Wenn ich /derby machen dann werde ich halt geportet in einem Auto, so das funzktioniert alles Prima und wenn mein Auto Kapput geht, sollte ich da wider respawnen in der Derby Arena oder wenn ich aus meinem Auto steig, sterbe ich zwar aber spawne ohne Auto in der Derbyarena
#include <a_samp>
#define FILTERSCRIPT
/// Farben ///
#define Rot 0xFF0000FF
#define Gelb 0xFFFF00FF
#if defined FILTERSCRIPT
forward Derbyzone1(playerid);
new InDerbyzone[MAX_PLAYERS];
new DerbyAuto[MAX_PLAYERS];
new Float:DerbySpawns[11][3] = {
{2517.0579,2742.8223,10.9917},
{2554.4119,2708.8955,10.9844},
{2521.2227,2765.4688,10.9917},
{2540.2751,2800.0952,10.8203},
{2545.3364,2811.7617,10.8203},
{2591.9863,2847.2393,10.8203},
{2672.6853,2792.0461,10.8203},
{2647.9390,2731.2349,10.8203},
{2629.5110,2721.6660,25.8222},
{2629.5110,2721.6660,25.8222},
{2655.8369,2697.6653,19.3222}
};
new DerbyAutos[11] = { /// Die 11 ist weil es 11 verschiedene Autos sind. Wenn du mehr machen willst, änder die 11 in die Anzahl der AUtos.! Oben mit den Spawns genauso.
411,
411,
411,
411,
411,
411,
411,
411,
411,
411,
411
};
// Alles Infernus.
public OnFilterScriptInit()
{
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/derby", true) == 0)
{
if(InDerbyzone[playerid])
return
SendClientMessage(playerid, Rot, " Du bist bereits im Derby! /DEnde um es zu verlassen!");
else
{
InDerbyzone[playerid] = 1;
Derbyzone1(playerid);
DestroyVehicle(DerbyAuto[playerid]);
new string[128],Name[20];
GetPlayerName(playerid,Name,20);
format(string, 256, "[DERBY] %s ist zum Derby gegangen! (/Derby)", Name);
SendClientMessageToAll(Gelb,string);
}
return 1;
}
if (strcmp("/dende", cmdtext, true) == 0)
{
if(!InDerbyzone[playerid])
return
SendClientMessage(playerid, Rot, " Das geht nur im Derby!");
if(!InDerbyzone[playerid])
return
SendClientMessage(playerid, Rot, " Das geht nur im Derby!");
SetPlayerInterior(playerid,0);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerHealth(playerid, 0);
InDerbyzone[playerid] = 0;
return 1;
}
return 0;
}
public OnPlayerSpawn(playerid)
{
if(InDerbyzone[playerid] == 1) Derbyzone1(playerid);
return 1;
}
public Derbyzone1(playerid)
{
if(InDerbyzone[playerid] == 1)
{
ResetPlayerWeapons(playerid);
InDerbyzone[playerid] = 1;
SetPlayerVirtualWorld(playerid, 2);
SetPlayerHealth(playerid, 100.0);
new randomport = random(sizeof(DerbySpawns));
SetPlayerPos(playerid, DerbySpawns[randomport][0], DerbySpawns[randomport][1], DerbySpawns[randomport][2]);
SetTimerEx("bla",200,0,"i",playerid);
}
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
if(InDerbyzone[playerid] == 1)
{
SetPlayerHealth(playerid, -100);
DestroyVehicle(DerbyAuto[playerid]);
}
return 1;
}
forward bla(playerid);
public bla(playerid)
{
new randomcar = random(sizeof(DerbyAutos));
new Float: X, Float: Y, Float: Z, Float: Angle;
GetPlayerPos(playerid, X, Y, Z );
GetPlayerFacingAngle(playerid,Angle);
DerbyAuto[playerid] = CreateVehicle(DerbyAutos[randomcar],X,Y,Z,Angle,-1,-1,-1);
SetVehicleVirtualWorld(DerbyAuto[playerid],2);
SetVehiclePos(DerbyAuto[playerid],X,Y,Z);
PutPlayerInVehicle(playerid,DerbyAuto[playerid],0);
SetCameraBehindPlayer(playerid);
return 1;
}
#endif
Ich hoffe ihr könnt mir helfen
mfg
Sahne