new retval[MAX_STRING], srclen; ??
heist das nicht : new retval[MAX_STRING], strlen ; Oder so?
new retval[MAX_STRING], srclen; ??
heist das nicht : new retval[MAX_STRING], strlen ; Oder so?
Muss das nicht so GetPlayerWeaponData(playerid,BanWeaponunterIDs[w],weapon,ammo); ?? ka hab noch nie sowas erstellt
Schlecht gemappt meins iss besser
aber trotzdem 2/10 xD
Kannst du nicht lesen ?
Da oben steht;
Ich beschäftigte mich erst mit Floats und getpos...
ich bräuchte ein Findcar befehl fürs odnungsamt -.- für das etb Carsystem
Meine idee würd ich gerne umsetzen
libmysqlclient_r.so.16 <---- damit kommt er nicht zurecht..
linux verwaltet .so dateien
iss falsch
du brauchst libmysqlclient_r.so
ich bräuchte ein Findcar befehl fürs odnungsamt -.- für das etb Carsystem
Ich beschäftigte mich erst mit Floats und getpos...
Wozu ts wenns teamviever gibt xD
Ich hab das ja jetzt bei mir drin und funltioniert auch..
Nun meine idee ich nutz ein GF edit..
Wenn jetzt jemand geblitzt wird... die blitzer stellen die cops auf..
das geld wird ja dem jenigen abgezogen.. ?
wie kann man das scripten das das geld in die Fraktionskasse gelangt vom LSPD oder beispiel Präsi?
Das dann bei den jenigen nen text erscheint also bei der fraktion x-blala ist xxx km/h gefahren und zahlt dem Staat xxx geld ...
das geld wird ja laut inc aus der geschwindigkeit berechnet?
Ist sowas denn möglich ???
Würd ich gerne wissen danke :)?
hallo ich habe ein GF edit also ein Loh
und bei mir werden keine BiZZ icons auf der map erstellt wodran liegt das ?
Hallo woll mal fragen was er damit meint..
[14:11:47] Pickups Max = 2048, Current Pickups = 294
[14:11:47] _______________________________________
[14:11:47] Das Script wurde Vollständig geladen!
[14:11:47] S4Y-Roleplay Reallife: LS/SF/LV
[14:11:47] _______________________________________
[14:11:47]
[14:11:47] Number of vehicle models: 91
[14:11:48] Incoming connection: 127.0.0.1:57747
[14:11:48] [npc:join] albino has joined the server (0:127.0.0.1)
[14:12:08]
[14:12:08] =======================================
[14:12:08] | |
[14:12:08] | Error: Could not connect to YSI |
[14:12:08] | update server (response was 003). |
[14:12:08] | |
[14:12:08] =======================================
[14:12:08]
Er läuft zwar aber error iss bei mir nix gutes ?
Muss er aber da beim einsteigen die engine des cars aus iss
aber hat sich erledigt
Dank dem realistischem motorsystem connectet mein Busbot nun nicht mehr...
oder so...
Wie mach ich das wieder das er connectet ?
bzw das er den motor startet er muss dafür die JUMP taste drücken
Warum nimmt er nicht das fertig FS von FUNSOcke ? ?
#include <a_samp>
forward IfAutoKaputtTimer(playerid);
forward Float:GetDistanceBetweenPlayers(p1,p2);
#define COLOR_RED 0xE60000FF
#define COLOR_WHITE 0xFFFFFFFF
static bool:PlayerMessageMotorschaden[MAX_PLAYERS] = { false };
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Feuerwehr Script by Funsocke");
print("--------------------------------------\n");
SetTimer("IfAutoKaputtTimer", 1000, 1);
return 1;
}
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
public OnPlayerDisconnect(playerid, reason)
{
PlayerMessageMotorschaden[playerid] = false;
return 1;
}
public Float:GetDistanceBetweenPlayers(p1,p2){
new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
if (!IsPlayerConnected(p1) || !IsPlayerConnected(p2)){
return -1.00;
}
GetPlayerPos(p1,x1,y1,z1);
GetPlayerPos(p2,x2,y2,z2);
return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
}
public IfAutoKaputtTimer(playerid)
{
new Float:health;
new string[256];
new vehicleid = GetPlayerVehicleID(playerid);
if(IsPlayerInAnyVehicle(playerid))
{
GetVehicleHealth(vehicleid, health);
/* format(string, 256, "~n~~n~~n~~n~~n~~n~~g~Auto Schaden : ~w~%.0f",health)*/
GameTextForPlayer(playerid, string, 2000, 5);
}
new VID, Float:h_vid;
if(IsPlayerConnected(playerid) && IsPlayerInAnyVehicle(playerid))
{
VID = GetPlayerVehicleID(playerid);
GetVehicleHealth(VID, h_vid);
if(h_vid <= 500 && PlayerMessageMotorschaden[playerid] == false)
{
TogglePlayerControllable(playerid, 0);
SendClientMessage(playerid, 0xFF6900AA, "Dieses Fahrzeug hat nun einen Motorschaden. Rufe die /112");
PlayerMessageMotorschaden[playerid] = true;
SetVehicleHealth(vehicleid, 230.0);
SetPlayerHealth(playerid,100);
} }
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new sendername[MAX_PLAYER_NAME];
new cmd[256];
new idx;
new string[256];
cmd = strtok(cmdtext,idx);
if(strcmp(cmd, "/befrei", true) == 0)
{
new tmp[256];
new giveplayer[200];
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
new otherplayer = strval(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "[BENUTZUNG]: /befrei [SpielerID]");
return 1;
}
if(!IsPlayerConnected(otherplayer)) return SendClientMessage(playerid, COLOR_WHITE, "Falsche SpielerID !");
if(GetDistanceBetweenPlayers(playerid,otherplayer <= 5.0))
{
GetPlayerName(otherplayer, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new Float:X;
new Float:Y;
new Float:Z;
GetPlayerPos(playerid,X,Y,Z);
SetPlayerPos(otherplayer,X,Y+1,Z);
format(string, sizeof(string), "Du hast %s gerettet!!.", giveplayer);
SendClientMessage(playerid,COLOR_WHITE, string);
SendClientMessage(otherplayer, COLOR_WHITE, "Du wurdest gerettet");
TogglePlayerControllable(playerid, true);
TogglePlayerControllable(otherplayer, 1);
}
else
{
SendClientMessage(playerid, COLOR_RED, "Der Spieler ist zu weit von dir entfernt !");
}
}
return 1;
}
if(strcmp(cmdtext, "/112", true) == 0 || strcmp(cmdtext, "/feuerwehr", true) == 0)
{
new pname[30], str[100];
GetPlayerName(playerid,pname,sizeof(pname));
format(str,sizeof(str), "%s braucht die Feuwehr!",pname);
SendClientMessageToAll(COLOR_RED,str);
return 1;
}
return 0;
}
einfach hier die werte ändern
public IfAutoKaputtTimer(playerid)
{
new Float:health;
new string[256];
new vehicleid = GetPlayerVehicleID(playerid);
if(IsPlayerInAnyVehicle(playerid))
{
GetVehicleHealth(vehicleid, health);
/* format(string, 256, "~n~~n~~n~~n~~n~~n~~g~Auto Schaden : ~w~%.0f",health)*/
GameTextForPlayer(playerid, string, 2000, 5);
}
new VID, Float:h_vid;
if(IsPlayerConnected(playerid) && IsPlayerInAnyVehicle(playerid))
{
VID = GetPlayerVehicleID(playerid);
GetVehicleHealth(VID, h_vid);
if(h_vid <= 500 && PlayerMessageMotorschaden[playerid] == false) // in der zeile zb statt 500 300 eintragen :)
{
TogglePlayerControllable(playerid, 0);
SendClientMessage(playerid, 0xFF6900AA, "Dieses Fahrzeug hat nun einen Motorschaden. Rufe die /112");
PlayerMessageMotorschaden[playerid] = true;
SetVehicleHealth(vehicleid, 230.0);
SetPlayerHealth(playerid,100);
} }
}
Du kannst die werte ändern bei ...
new Float:veh_hp,vehicleid = GetPlayerVehicleID(playerid);
GetVehicleHealth(vehicleid,veh_hp);
new random_string[30];
format(random_string,30,"%d",random(30));
veh_hp -= floatstr(random_string);
SetVehicleHealth(vehicleid, veh_hp);
Und ausmachen geht sowohl...
Wenn du die Actiontaste drückst..
Script anschauen und verstehen
Erstmal ein dank an Neophonix oder wie auch immer Super FS auch dir dank ich da du mir mit dem HP reduzieren geholfen hast...
Und auch ein dank an Chaosfatz der dies Möglich machte...
Nun eine Kleine information was hab ich hinzugefügt...
Also ich habe hinzugefügt..
#include <a_samp>
//CREDITS TO AN UNKNOWS AUTHOR FOR THE PROX DETECOTOR
//CREDITS TO NEOPHOENIX FOR THE OTHER
#define SCM SendClientMessage
#define COLOR_PURPLE 0xC2A2DAAA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_LIGHTRED 0xFF6347AA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_LIGHTGREEN 0x9ACD32AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_YELLOW2 0xF5DEB3AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_ROT 0xFF0000FF
#define COLOR_SCHWARZ 0x000000FF
#define COLOR_DUNKELGRUEN 0x006600FF
#define COLOR_GRUEN 0x00FF00FF
#define COLOR_WEISS 0xFFFFFFFF
#define COLOR_BLAU 0x0000FFFF
#define COLOR_GELB 0xFFFF00FF
#define COLOR_PINK 0xFF00FFFF
#define COLOR_LILA 0xCC33CACA
#define COLOR_HELLBLAU 0x3366FFCA
#define COLOR_WASSER 0x0066FFFF
#define COLOR_GIFT 0xCCFF00CA
#pragma tabsize 0
new MotorAN[MAX_VEHICLES];
new sendername[MAX_PLAYER_NAME];
new rauchtimer[MAX_PLAYERS];
forward Reduhp(playerid);
forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
forward Anstellen(playerid);
public OnFilterScriptInit()
{
print("\n--Motorsystem by NeoPhoenix--\n");
print("--Dieses Produkt steht unter Creativ Common Licenses--\n");
new Autos;
for(Autos=0;Autos<MAX_VEHICLES;Autos++)
return 1;
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new AutoID = GetPlayerVehicleID(playerid);
new AutoMOD = GetVehicleModel(playerid);
if(newstate == PLAYER_STATE_DRIVER)
{
if(MotorAN[AutoID] == 0 && AutoMOD != 510 && AutoMOD != 509 && AutoMOD != 481)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 510 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 509 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 481){
return 1;
}
TogglePlayerControllable(playerid,0);
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(AutoID,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(AutoID,0,lights,alarm,doors,bonnet,boot,objective);
SCM(playerid,COLOR_GIFT,"* Drücke SHIFT um den Motor zu starten");
}else{
SCM(playerid,COLOR_RED,"* Der Motor ist schon an!");
}
}
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
TogglePlayerControllable(playerid,1);
new Vehicle = GetPlayerVehicleID(playerid);
if(MotorAN[Vehicle] == 1)
{
SCM(playerid, COLOR_GIFT, "Du hast den Motor laufen lassen!");
}
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_ACTION)
{
if(IsPlayerInAnyVehicle(playerid))
{
new Vehicle = GetPlayerVehicleID(playerid);
if(MotorAN[Vehicle] == 1)
{
RemovePlayerFromVehicle(playerid);
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(Vehicle,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(Vehicle,0,lights,alarm,doors,bonnet,boot,objective);
SCM(playerid,COLOR_RED,"* Du hast den Motor ausgestellt.");
TogglePlayerControllable(playerid,1);
MotorAN[Vehicle] = 0;
}
}
// }
}
if(newkeys == KEY_JUMP)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(IsPlayerConnected(playerid))
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 510 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 509 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 481){
return 1;
}
new Vehicle = GetPlayerVehicleID(playerid);
if(MotorAN[Vehicle] == 0)
{
new string[256];
SCM(playerid,COLOR_GIFT,"* Starte Motor...");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s dreht den Zündschlüssel um und versucht den Motor zu starten.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GameTextForPlayer(playerid,"~n~~n~~n~~n~~n~~n~~n~~g~Motor wird gestartet...",3000,3);
SetTimerEx("Anstellen",3500,0,"i",playerid);
}
}
}
}
return 1;
}
public Anstellen(playerid)
{
new Vehicle = GetPlayerVehicleID(playerid);
new Zufall;
if(IsPlayerConnected(playerid))
{
if(IsPlayerInAnyVehicle(playerid))
{
Zufall = random(10);
switch(Zufall)
{
case 0:
{
new string[256];
MotorAN[Vehicle] = 1;
TogglePlayerControllable(playerid,1);
GameTextForPlayer(playerid,"~r~Motor Gestartet", 1000, 1);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s hat den Motor gestartet.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(Vehicle,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(Vehicle,1,lights,alarm,doors,bonnet,boot,objective);
}
case 1:
{
new string[256];
SendClientMessage(playerid,COLOR_RED,"* Der Motor erlitt durch das starten einen kleinen schaden *");
format(string, sizeof(string), "* %s hat den Motor starten können aber er hat leichte kratzer", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(Vehicle,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(Vehicle,1,lights,alarm,doors,bonnet,boot,objective);
new Float:veh_hp,vehicleid = GetPlayerVehicleID(playerid);
GetVehicleHealth(vehicleid,veh_hp);
new random_string[10];
format(random_string,10,"%d",random(10));
veh_hp -= floatstr(random_string);
SetVehicleHealth(vehicleid, veh_hp);
TogglePlayerControllable(playerid,1);
MotorAN[Vehicle] = 1;
}
case 2:
{
new string[256];
SendClientMessage(playerid,COLOR_RED,"* Der Motor erlitt durch das starten einen geringen schaden *");
format(string, sizeof(string), "* %s hat den Motor starten können aber er ist leicht beschädigt", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(Vehicle,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(Vehicle,1,lights,alarm,doors,bonnet,boot,objective);
new Float:veh_hp,vehicleid = GetPlayerVehicleID(playerid);
GetVehicleHealth(vehicleid,veh_hp);
new random_string[15];
format(random_string,15,"%d",random(15));
veh_hp -= floatstr(random_string);
SetVehicleHealth(vehicleid, veh_hp);
TogglePlayerControllable(playerid,1);
MotorAN[Vehicle] = 1;
}
case 3:
{
new string[256];
MotorAN[Vehicle] = 1;
TogglePlayerControllable(playerid,1);
GameTextForPlayer(playerid,"~r~Motor Gestartet", 1000, 1);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s hat den Motor gestartet.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(Vehicle,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(Vehicle,1,lights,alarm,doors,bonnet,boot,objective);
}
case 4:
{
new string[256];
SendClientMessage(playerid,COLOR_RED,"* Der Motor erlitt durch das starten einen kleinen schaden *");
format(string, sizeof(string), "* %s hat den Motor starten können aber das öl läuft aus..", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(Vehicle,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(Vehicle,1,lights,alarm,doors,bonnet,boot,objective);
new Float:veh_hp,vehicleid = GetPlayerVehicleID(playerid);
GetVehicleHealth(vehicleid,veh_hp);
new random_string[15];
format(random_string,15,"%d",random(15));
veh_hp -= floatstr(random_string);
SetVehicleHealth(vehicleid, veh_hp);
TogglePlayerControllable(playerid,1);
MotorAN[Vehicle] = 1;
}
case 5:
{
new string[256];
SendClientMessage(playerid,COLOR_RED,"* Der Motor erlitt durch das starten einen sehr mittleren schaden *");
format(string, sizeof(string), "* %s hat den Motor starten können aber er raucht etwas", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(Vehicle,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(Vehicle,1,lights,alarm,doors,bonnet,boot,objective);
new Float:veh_hp,vehicleid = GetPlayerVehicleID(playerid);
GetVehicleHealth(vehicleid,veh_hp);
new random_string[20];
format(random_string,20,"%d",random(20));
veh_hp -= floatstr(random_string);
SetVehicleHealth(vehicleid, veh_hp);
TogglePlayerControllable(playerid,1);
MotorAN[Vehicle] = 1;
}
case 6:
{
new string[256];
SendClientMessage(playerid,COLOR_RED,"* Der Motor erlitt durch das starten einen mittleren schaden *");
format(string, sizeof(string), "* %s hat den Motor starten können aber irgendwas stimmt noch nicht..", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(Vehicle,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(Vehicle,1,lights,alarm,doors,bonnet,boot,objective);
new Float:veh_hp,vehicleid = GetPlayerVehicleID(playerid);
GetVehicleHealth(vehicleid,veh_hp);
new random_string[10];
format(random_string,10,"%d",random(10));
veh_hp -= floatstr(random_string);
SetVehicleHealth(vehicleid, veh_hp);
}
case 7:
{
new string[256];
SendClientMessage(playerid,COLOR_RED,"* Der Motor erlitt durch das starten einen großen schaden *");
format(string, sizeof(string), "* %s hat den Motor starten können aber er ist stark beschädigt", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(Vehicle,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(Vehicle,1,lights,alarm,doors,bonnet,boot,objective);
new Float:veh_hp,vehicleid = GetPlayerVehicleID(playerid);
GetVehicleHealth(vehicleid,veh_hp);
new random_string[30];
format(random_string,30,"%d",random(30));
veh_hp -= floatstr(random_string);
SetVehicleHealth(vehicleid, veh_hp);
TogglePlayerControllable(playerid,1);
MotorAN[Vehicle] = 1;
}
case 8:
{
new string[256];
SendClientMessage(playerid,COLOR_RED,"* Der Motor erlitt durch das starten einen sehr Großen schaden *");
format(string, sizeof(string), "* %s hat den Motor starten können aber er qualmt allmälig schon", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(Vehicle,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(Vehicle,1,lights,alarm,doors,bonnet,boot,objective);
new Float:veh_hp,vehicleid = GetPlayerVehicleID(playerid);
GetVehicleHealth(vehicleid,veh_hp);
if(veh_hp >= 555) {
SetVehicleHealth(vehicleid, 552);
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
}
}
case 9:
{
rauchtimer[playerid] = SetTimerEx("Reduhp", 1000, 1, "i", playerid);
new string[256];
//SendClientMessage(playerid,COLOR_RED,"* Der Motor erlitt durch das starten einen kleinen schaden *");
format(string, sizeof(string), "* %s hat den Motor nicht starten können er ist nicht mehr funktionstüchtig", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SCM(playerid, COLOR_ROT, "Du erstickst langsam in den Flammen rufe die Feuerwehr oder du bist tot");
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(Vehicle,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(Vehicle,0,lights,alarm,doors,bonnet,boot,objective);
new Float:veh_hp,vehicleid = GetPlayerVehicleID(playerid);
MotorAN[Vehicle] = 1;
GetVehicleHealth(vehicleid,veh_hp);
if(veh_hp >= 555) {
SetVehicleHealth(vehicleid, 300);
TogglePlayerControllable(playerid,0);
}
}
case 10:
{
new string[256];
SendClientMessage(playerid,COLOR_RED,"* Der Motor konnte nicht gestartet werden! *");
format(string, sizeof(string), "* %s hat den Motor absaufen lassen.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
}
}
return 1;
}
public Reduhp(playerid)
{
new Float:hp;
new random_string[3];
format(random_string,3,"%d",random(3));
GetPlayerHealth(playerid,hp);
hp -= floatstr(random_string);
if(hp > 09.0)
{
SetPlayerHealth(playerid, hp);
}
else
{
SCM(playerid, COLOR_RED, "Du bist durch die gase des feuers Sehr Stark geschwächt...und kannst dich deswegen nicht bewegen..");
SCM(playerid, COLOR_RED, "Ein Artzt kann dich nur noch retten rufe ihn mit /service medic");
RemovePlayerFromVehicle(playerid);
new Float:PosX, Float:PosY, Float:Angle, Float:PosZ;
GetPlayerPos(playerid, PosX, PosY, PosZ);
GetPlayerFacingAngle(playerid, Angle);
SetPlayerPos(playerid,PosX+3,PosY+3,PosZ+2.1);
ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 1200);
GetPlayerPos(playerid, PosX, PosY, PosZ);
SetPlayerCheckpoint(playerid, PosX, PosY, PosZ, 3.0);
KillTimer(rauchtimer[playerid]);
}
}
public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
if(IsPlayerConnected(playerid))
{
new Float:posx, Float:posy, Float:posz;
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
GetPlayerPos(i, posx, posy, posz);
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
{
SendClientMessage(i, col1, string);
}
else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
{
SendClientMessage(i, col2, string);
}
else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
{
SendClientMessage(i, col3, string);
}
else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
{
SendClientMessage(i, col4, string);
}
else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
SendClientMessage(i, col5, string);
}
}
}
}
return 1;
}
Ich hoffe ihr könnt damit was anfangen...
Ein dank nochmal an ChaosFatz uund Neo
- Bitte ein Admin in den schowroom verschieben - Da ich da nicht Posten kann
hier auch nochmal ein Pastebin
Danke
Kann geschlossenwerden habs gelöst..
Okay ich poste mal das filterscript iss nur editiert weil ich fun sachen hinzugefügt habe
#include <a_samp>
//CREDITS TO AN UNKNOWS AUTHOR FOR THE PROX DETECOTOR
//CREDITS TO NEOPHOENIX FOR THE OTHER
#define SCM SendClientMessage
#define COLOR_PURPLE 0xC2A2DAAA
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_LIGHTRED 0xFF6347AA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_LIGHTGREEN 0x9ACD32AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_YELLOW2 0xF5DEB3AA
#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_ROT 0xFF0000FF
#define COLOR_SCHWARZ 0x000000FF
#define COLOR_DUNKELGRUEN 0x006600FF
#define COLOR_GRUEN 0x00FF00FF
#define COLOR_WEISS 0xFFFFFFFF
#define COLOR_BLAU 0x0000FFFF
#define COLOR_GELB 0xFFFF00FF
#define COLOR_PINK 0xFF00FFFF
#define COLOR_LILA 0xCC33CACA
#define COLOR_HELLBLAU 0x3366FFCA
#define COLOR_WASSER 0x0066FFFF
#define COLOR_GIFT 0xCCFF00CA
#pragma tabsize 0
new MotorAN[MAX_VEHICLES];
new sendername[MAX_PLAYER_NAME];
new rauchtimer[MAX_PLAYERS];
forward Reduhp(playerid);
forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
forward Anstellen(playerid);
public OnFilterScriptInit()
{
print("\n--Motorsystem by NeoPhoenix--\n");
print("--Dieses Produkt steht unter Creativ Common Licenses--\n");
new Autos;
for(Autos=0;Autos<MAX_VEHICLES;Autos++)
return 1;
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new AutoID = GetPlayerVehicleID(playerid);
new AutoMOD = GetVehicleModel(playerid);
if(newstate == PLAYER_STATE_DRIVER)
{
if(MotorAN[AutoID] == 0 && AutoMOD != 510 && AutoMOD != 509 && AutoMOD != 481)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 510 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 509 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 481){
return 1;
}
TogglePlayerControllable(playerid,0);
SCM(playerid,COLOR_GIFT,"* Drücke SHIFT um den Motor zu starten");
}else{
SCM(playerid,COLOR_RED,"* Der Motor ist schon an!");
}
}
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
TogglePlayerControllable(playerid,1);
new Vehicle = GetPlayerVehicleID(playerid);
if(MotorAN[Vehicle] == 1)
{
SCM(playerid, COLOR_GIFT, "Du hast den Motor laufen lassen!");
}
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_ACTION)
{
if(IsPlayerInAnyVehicle(playerid))
{
new Vehicle = GetPlayerVehicleID(playerid);
if(MotorAN[Vehicle] == 1)
{
RemovePlayerFromVehicle(playerid);
SCM(playerid,COLOR_RED,"* Du hast den Motor ausgestellt.");
TogglePlayerControllable(playerid,1);
MotorAN[Vehicle] = 0;
}
}
// }
}
if(newkeys == KEY_JUMP)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(IsPlayerConnected(playerid))
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 510 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 509 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 481){
return 1;
}
new Vehicle = GetPlayerVehicleID(playerid);
if(MotorAN[Vehicle] == 0)
{
new string[256];
SCM(playerid,COLOR_GIFT,"* Starte Motor...");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s dreht den Zündschlüssel um und versucht den Motor zu starten.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GameTextForPlayer(playerid,"~n~~n~~n~~n~~n~~n~~n~~g~Motor wird gestartet...",3000,3);
SetTimerEx("Anstellen",3500,0,"i",playerid);
}
}
}
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/p", true))
{
rauchtimer[playerid] = SetTimerEx("Reduhp", 500, 1, "i", playerid);
}
}
public Anstellen(playerid)
{
new Vehicle = GetPlayerVehicleID(playerid);
new Zufall;
if(IsPlayerConnected(playerid))
{
if(IsPlayerInAnyVehicle(playerid))
{
Zufall = random(10);
switch(Zufall)
{
case 0:
{
new string[256];
MotorAN[Vehicle] = 1;
TogglePlayerControllable(playerid,1);
GameTextForPlayer(playerid,"~r~Motor Gestartet", 1000, 1);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s hat den Motor gestartet.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
case 1:
{
new string[256];
SendClientMessage(playerid,COLOR_RED,"* Der Motor erlitt durch das starten einen kleinen schaden *");
format(string, sizeof(string), "* %s hat den Motor starten können aber er hat leichte kratzer", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new Float:veh_hp,vehicleid = GetPlayerVehicleID(playerid);
GetVehicleHealth(vehicleid,veh_hp);
new random_string[10];
format(random_string,10,"%d",random(10));
veh_hp -= floatstr(random_string);
SetVehicleHealth(vehicleid, veh_hp);
TogglePlayerControllable(playerid,1);
MotorAN[Vehicle] = 1;
}
case 2:
{
new string[256];
SendClientMessage(playerid,COLOR_RED,"* Der Motor erlitt durch das starten einen geringen schaden *");
format(string, sizeof(string), "* %s hat den Motor starten können aber er ist leicht beschädigt", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new Float:veh_hp,vehicleid = GetPlayerVehicleID(playerid);
GetVehicleHealth(vehicleid,veh_hp);
new random_string[15];
format(random_string,15,"%d",random(15));
veh_hp -= floatstr(random_string);
SetVehicleHealth(vehicleid, veh_hp);
TogglePlayerControllable(playerid,1);
MotorAN[Vehicle] = 1;
}
case 3:
{
new string[256];
MotorAN[Vehicle] = 1;
TogglePlayerControllable(playerid,1);
GameTextForPlayer(playerid,"~r~Motor Gestartet", 1000, 1);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s hat den Motor gestartet.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
case 4:
{
new string[256];
SendClientMessage(playerid,COLOR_RED,"* Der Motor erlitt durch das starten einen kleinen schaden *");
format(string, sizeof(string), "* %s hat den Motor starten können aber das öl läuft aus..", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new Float:veh_hp,vehicleid = GetPlayerVehicleID(playerid);
GetVehicleHealth(vehicleid,veh_hp);
new random_string[15];
format(random_string,15,"%d",random(15));
veh_hp -= floatstr(random_string);
SetVehicleHealth(vehicleid, veh_hp);
TogglePlayerControllable(playerid,1);
MotorAN[Vehicle] = 1;
}
case 5:
{
new string[256];
SendClientMessage(playerid,COLOR_RED,"* Der Motor erlitt durch das starten einen sehr mittleren schaden *");
format(string, sizeof(string), "* %s hat den Motor starten können aber er raucht etwas", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new Float:veh_hp,vehicleid = GetPlayerVehicleID(playerid);
GetVehicleHealth(vehicleid,veh_hp);
new random_string[20];
format(random_string,20,"%d",random(20));
veh_hp -= floatstr(random_string);
SetVehicleHealth(vehicleid, veh_hp);
TogglePlayerControllable(playerid,1);
MotorAN[Vehicle] = 1;
}
case 6:
{
new string[256];
SendClientMessage(playerid,COLOR_RED,"* Der Motor erlitt durch das starten einen mittleren schaden *");
format(string, sizeof(string), "* %s hat den Motor starten können aber irgendwas stimmt noch nicht..", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new Float:veh_hp,vehicleid = GetPlayerVehicleID(playerid);
GetVehicleHealth(vehicleid,veh_hp);
new random_string[10];
format(random_string,10,"%d",random(10));
veh_hp -= floatstr(random_string);
SetVehicleHealth(vehicleid, veh_hp);
}
case 7:
{
new string[256];
SendClientMessage(playerid,COLOR_RED,"* Der Motor erlitt durch das starten einen großen schaden *");
format(string, sizeof(string), "* %s hat den Motor starten können aber er ist stark beschädigt", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new Float:veh_hp,vehicleid = GetPlayerVehicleID(playerid);
GetVehicleHealth(vehicleid,veh_hp);
new random_string[30];
format(random_string,30,"%d",random(30));
veh_hp -= floatstr(random_string);
SetVehicleHealth(vehicleid, veh_hp);
TogglePlayerControllable(playerid,1);
MotorAN[Vehicle] = 1;
}
case 8:
{
new string[256];
SendClientMessage(playerid,COLOR_RED,"* Der Motor erlitt durch das starten einen sehr Großen schaden *");
format(string, sizeof(string), "* %s hat den Motor starten können aber er qualmt allmälig schon", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new Float:veh_hp,vehicleid = GetPlayerVehicleID(playerid);
GetVehicleHealth(vehicleid,veh_hp);
if(veh_hp >= 555) {
SetVehicleHealth(vehicleid, 552);
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
}
}
case 9:
{
rauchtimer[playerid] = SetTimerEx("Reduhp", 1000, 1, "i", playerid);
new string[256];
//SendClientMessage(playerid,COLOR_RED,"* Der Motor erlitt durch das starten einen kleinen schaden *");
format(string, sizeof(string), "* %s hat den Motor starten können aber er ist nicht mehr funktionstüchtig", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SCM(playerid, COLOR_ROT, "Du erstickst langsam in den Flammen rufe die Feuerwehr oder du bist tot");
new Float:veh_hp,vehicleid = GetPlayerVehicleID(playerid);
MotorAN[Vehicle] = 1;
GetVehicleHealth(vehicleid,veh_hp);
if(veh_hp >= 555) {
SetVehicleHealth(vehicleid, 300);
TogglePlayerControllable(playerid,0);
}
}
case 10:
{
new string[256];
SendClientMessage(playerid,COLOR_RED,"* Der Motor konnte nicht gestartet werden! *");
format(string, sizeof(string), "* %s hat den Motor absaufen lassen.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
}
}
return 1;
}
public Reduhp(playerid)
{
new Float:hp;
new random_string[3];
format(random_string,3,"%d",random(3));
GetPlayerHealth(playerid,hp);
hp -= floatstr(random_string);
if(hp > 09.0)
{
SetPlayerHealth(playerid, hp);
}
else
{
SCM(playerid, COLOR_RED, "Du bist durch die gase des feuers Sehr Stark geschwächt...und kannst dich deswegen nicht bewegen..");
SCM(playerid, COLOR_RED, "Ein Artzt kann dich nur noch retten rufe ihn mit /service medic");
RemovePlayerFromVehicle(playerid);
new Float:PosX, Float:PosY, Float:Angle, Float:PosZ;
GetPlayerPos(playerid, PosX, PosY, PosZ);
GetPlayerFacingAngle(playerid, Angle);
SetPlayerPos(playerid,PosX+3,PosY+3,PosZ+2.1);
ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 1200);
GetPlayerPos(playerid, PosX, PosY, PosZ);
SetPlayerCheckpoint(playerid, PosX, PosY, PosZ, 3.0);
KillTimer(rauchtimer[playerid]);
}
}
public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
{
if(IsPlayerConnected(playerid))
{
new Float:posx, Float:posy, Float:posz;
new Float:oldposx, Float:oldposy, Float:oldposz;
new Float:tempposx, Float:tempposy, Float:tempposz;
GetPlayerPos(playerid, oldposx, oldposy, oldposz);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
GetPlayerPos(i, posx, posy, posz);
tempposx = (oldposx -posx);
tempposy = (oldposy -posy);
tempposz = (oldposz -posz);
if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
{
SendClientMessage(i, col1, string);
}
else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
{
SendClientMessage(i, col2, string);
}
else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
{
SendClientMessage(i, col3, string);
}
else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
{
SendClientMessage(i, col4, string);
}
else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
SendClientMessage(i, col5, string);
}
}
}
}
return 1;
}
Ja es iss so das wenn man ins auto steigt kein qualm ausm auspuff kommt und sozusagen erst dann losfahren kann wenn motor gestartet ist..
Verstehst du`?
Mal ein ausschnitt aus Neons motorsystem vllt machst du mir das schnell zurecht..
Ich kann nur dinge verstehen wenn ich vorgaben habe die selbst dann veränder..
Jeder lernt anders
Erstmal das einsteigen da soll er ja auss sein..
public OnPlayerStateChange(playerid, newstate, oldstate)
{
new AutoID = GetPlayerVehicleID(playerid);
new AutoMOD = GetVehicleModel(playerid);
if(newstate == PLAYER_STATE_DRIVER)
{
if(MotorAN[AutoID] == 0 && AutoMOD != 510 && AutoMOD != 509 && AutoMOD != 481)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 510 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 509 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 481){
return 1;
}
TogglePlayerControllable(playerid,0);
SCM(playerid,COLOR_GIFT,"* Drücke SHIFT um den Motor zu starten");
}else{
SCM(playerid,COLOR_RED,"* Der Motor ist schon an!");
}
}
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
TogglePlayerControllable(playerid,1);
new Vehicle = GetPlayerVehicleID(playerid);
if(MotorAN[Vehicle] == 1)
{
SCM(playerid, COLOR_GIFT, "Du hast den Motor laufen lassen!");
}
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == KEY_ACTION)
{
if(IsPlayerInAnyVehicle(playerid))
{
new Vehicle = GetPlayerVehicleID(playerid);
if(MotorAN[Vehicle] == 1)
{
RemovePlayerFromVehicle(playerid);
SCM(playerid,COLOR_RED,"* Du hast den Motor ausgestellt.");
TogglePlayerControllable(playerid,1);
MotorAN[Vehicle] = 0;
}
}
// }
}
if(newkeys == KEY_JUMP)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(IsPlayerConnected(playerid))
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 510 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 509 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 481){
return 1;
}
new Vehicle = GetPlayerVehicleID(playerid);
if(MotorAN[Vehicle] == 0)
{
new string[256];
SCM(playerid,COLOR_GIFT,"* Starte Motor...");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s dreht den Zündschlüssel um und versucht den Motor zu starten.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GameTextForPlayer(playerid,"~n~~n~~n~~n~~n~~n~~n~~g~Motor wird gestartet...",3000,3);
SetTimerEx("Anstellen",3500,0,"i",playerid);
}
}
}
}
return 1;
}
So und hier der timer anstellen...
Da soll auch der motor erst angehen wenn der timer abgelaufen ist
public Anstellen(playerid)
{
new Vehicle = GetPlayerVehicleID(playerid);
new Zufall;
if(IsPlayerConnected(playerid))
{
if(IsPlayerInAnyVehicle(playerid))
{
Zufall = random(10);
switch(Zufall)
{
case 0:
{
new string[256];
MotorAN[Vehicle] = 1;
TogglePlayerControllable(playerid,1);
GameTextForPlayer(playerid,"~r~Motor Gestartet", 1000, 1);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s hat den Motor gestartet.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
case 1:
{
new string[256];
SendClientMessage(playerid,COLOR_RED,"* Der Motor erlitt durch das starten einen kleinen schaden *");
format(string, sizeof(string), "* %s hat den Motor starten können aber er hat leichte kratzer", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new Float:veh_hp,vehicleid = GetPlayerVehicleID(playerid);
GetVehicleHealth(vehicleid,veh_hp);
new random_string[10];
format(random_string,10,"%d",random(10));
veh_hp -= floatstr(random_string);
SetVehicleHealth(vehicleid, veh_hp);
TogglePlayerControllable(playerid,1);
MotorAN[Vehicle] = 1;
}
case 2:
{
new string[256];
SendClientMessage(playerid,COLOR_RED,"* Der Motor erlitt durch das starten einen geringen schaden *");
format(string, sizeof(string), "* %s hat den Motor starten können aber er ist leicht beschädigt", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new Float:veh_hp,vehicleid = GetPlayerVehicleID(playerid);
GetVehicleHealth(vehicleid,veh_hp);
new random_string[15];
format(random_string,15,"%d",random(15));
veh_hp -= floatstr(random_string);
SetVehicleHealth(vehicleid, veh_hp);
TogglePlayerControllable(playerid,1);
MotorAN[Vehicle] = 1;
}
case 3:
{
new string[256];
MotorAN[Vehicle] = 1;
TogglePlayerControllable(playerid,1);
GameTextForPlayer(playerid,"~r~Motor Gestartet", 1000, 1);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s hat den Motor gestartet.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
case 4:
{
new string[256];
SendClientMessage(playerid,COLOR_RED,"* Der Motor erlitt durch das starten einen kleinen schaden *");
format(string, sizeof(string), "* %s hat den Motor starten können aber das öl läuft aus..", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new Float:veh_hp,vehicleid = GetPlayerVehicleID(playerid);
GetVehicleHealth(vehicleid,veh_hp);
new random_string[15];
format(random_string,15,"%d",random(15));
veh_hp -= floatstr(random_string);
SetVehicleHealth(vehicleid, veh_hp);
TogglePlayerControllable(playerid,1);
MotorAN[Vehicle] = 1;
}
case 5:
{
new string[256];
SendClientMessage(playerid,COLOR_RED,"* Der Motor erlitt durch das starten einen sehr mittleren schaden *");
format(string, sizeof(string), "* %s hat den Motor starten können aber er raucht etwas", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new Float:veh_hp,vehicleid = GetPlayerVehicleID(playerid);
GetVehicleHealth(vehicleid,veh_hp);
new random_string[20];
format(random_string,20,"%d",random(20));
veh_hp -= floatstr(random_string);
SetVehicleHealth(vehicleid, veh_hp);
TogglePlayerControllable(playerid,1);
MotorAN[Vehicle] = 1;
}
case 6:
{
new string[256];
SendClientMessage(playerid,COLOR_RED,"* Der Motor erlitt durch das starten einen mittleren schaden *");
format(string, sizeof(string), "* %s hat den Motor starten können aber irgendwas stimmt noch nicht..", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new Float:veh_hp,vehicleid = GetPlayerVehicleID(playerid);
GetVehicleHealth(vehicleid,veh_hp);
new random_string[10];
format(random_string,10,"%d",random(10));
veh_hp -= floatstr(random_string);
SetVehicleHealth(vehicleid, veh_hp);
}
case 7:
{
new string[256];
SendClientMessage(playerid,COLOR_RED,"* Der Motor erlitt durch das starten einen großen schaden *");
format(string, sizeof(string), "* %s hat den Motor starten können aber er ist stark beschädigt", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new Float:veh_hp,vehicleid = GetPlayerVehicleID(playerid);
GetVehicleHealth(vehicleid,veh_hp);
new random_string[30];
format(random_string,30,"%d",random(30));
veh_hp -= floatstr(random_string);
SetVehicleHealth(vehicleid, veh_hp);
TogglePlayerControllable(playerid,1);
MotorAN[Vehicle] = 1;
}
case 8:
{
new string[256];
SendClientMessage(playerid,COLOR_RED,"* Der Motor erlitt durch das starten einen sehr Großen schaden *");
format(string, sizeof(string), "* %s hat den Motor starten können aber er qualmt allmälig schon", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
new Float:veh_hp,vehicleid = GetPlayerVehicleID(playerid);
GetVehicleHealth(vehicleid,veh_hp);
if(veh_hp >= 555) {
SetVehicleHealth(vehicleid, 552);
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
}
}
case 9:
{
rauchtimer[playerid] = SetTimerEx("Reduhp", 1000, 1, "i", playerid);
new string[256];
//SendClientMessage(playerid,COLOR_RED,"* Der Motor erlitt durch das starten einen kleinen schaden *");
format(string, sizeof(string), "* %s hat den Motor starten können aber er ist nicht mehr funktionstüchtig", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SCM(playerid, COLOR_ROT, "Du erstickst langsam in den Flammen rufe die Feuerwehr oder du bist tot");
new Float:veh_hp,vehicleid = GetPlayerVehicleID(playerid);
MotorAN[Vehicle] = 1;
GetVehicleHealth(vehicleid,veh_hp);
if(veh_hp >= 555) {
SetVehicleHealth(vehicleid, 300);
TogglePlayerControllable(playerid,0);
}
}
case 10:
{
new string[256];
SendClientMessage(playerid,COLOR_RED,"* Der Motor konnte nicht gestartet werden! *");
format(string, sizeof(string), "* %s hat den Motor absaufen lassen.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
}
}
return 1;
}
Schon klar aber das hilft mir grad wenig zuviele zahlen und variablem .. wo muss ich das einsetzen damit das auch in verbindung mit dem motorsystem von neo arbeitet bin grad bvei floats und so..