Danke funktioniert jetzt!
Beiträge von Calaze_Carrey
-
-
-
Hey Leute,
habe ein Problem mit SetPlayerWantedLevel.
Wenn ein Spieler einen anderen Killt soll er 2 Wanteds erhalten. Die bekommt er auch, wenn er dann aber einen 2. Spieler tötet bekommt er kurzzeitig 2 Wanteds dazu die Ihm später wieder abgezogen werden! -
Danke funktioniert
-
Hey Leute,
hätte mal eine Frage bezüglich der Interiors.
Ich möchte Abfragen ob der Spieler in einem Interior ist oder nicht. Und wenn er in einem ist, kann er keine Bombe legen.
Wie mache ich das?Code
Alles anzeigenif(strcmp(cmd, "/legbombe", true) == 0 || strcmp(cmd, "/bombelegen", true) == 0) { if(PlayerInfo[playerid][pMember] == 17 || PlayerInfo[playerid][pLeader] == 17) { if(BombStatus == 1) { SendClientMessage(playerid, COLOR_RED, "Sie können nur alle 40 Minuten eine Bombe legen."); } else if(PlayerInfo[playerid][pJailed] > 0) { SendClientMessage(playerid, COLOR_RED, "Sie können im Gefägnis keine Bombe bauen."); } else { ShowMenuForPlayer(Menu:BOMB,playerid); } } else { SendClientMessage(playerid, COLOR_RED, "Sie sind kein Terrorist."); } return 1; }
-
Guten Abend,
ich bins mal wieder. Sry das ich euch hier auf die Ketten gehe
Habe aber wieder mal ein Problem.Nachdem die Kompilierung erfolgreich war funktioniert das FS nicht ganz so wie ich es mir vorstelle.
Ich habe nun also das FS auf meinem Test Server getestet (Script: Grand Larc+keine Filterscripts), dort hat alles Wunderbar funktioniert.
Nun habe ich das FS auf meinen "richtigen Server" gezogen, und dort war folgendes Problem: Siehe Video!Video:
Externer Inhalt www.youtube.comInhalte von externen Seiten werden ohne Ihre Zustimmung nicht automatisch geladen und angezeigt.Durch die Aktivierung der externen Inhalte erklären Sie sich damit einverstanden, dass personenbezogene Daten an Drittplattformen übermittelt werden. Mehr Informationen dazu haben wir in unserer Datenschutzerklärung zur Verfügung gestellt. -
Danke.
0 Errors, 0 Warnungen
Kompilierung erfolgreich -
Guten Abend,
ich bekommt folgende Errors im Filterscript:Zeile (190) : error 008: must be a constant expression; assumed zero
Zeile (212) : error 008: must be a constant expression; assumed zero
Zeile (240) : error 008: must be a constant expression; assumed zero
Zeile (255) : error 008: must be a constant expression; assumed zero
Zeile (266) : error 008: must be a constant expression; assumed zero
Zeile (277) : error 008: must be a constant expression; assumed zero
Zeile (286) : error 008: must be a constant expression; assumed zero
Zeile (296) : error 008: must be a constant expression; assumed zero
Zeile (306) : error 008: must be a constant expression; assumed zeroKann mit dieses nicht viel Anfangen da ich nicht sehr viel vom Scripten verstehe und gerade noch dabei bin etwas zu lernen.
Jeffry habe versucht das Umzusetzen was Sie mir vorhin geraten haben.Filterscript:
/* Eventsystem by ErikSon */
#include <a_samp>
#include <ocmd>//Farben
#define Schwarz 0x000000FF
#define Rot 0xE10000FF
#define Gelb 0xFFE600FF
#define HBlau 0x00FFFFFF
#define DBlau 0x0000FFFF
#define Blau 0x2E9AFEFF
#define HGruen 0x00FF00FF
#define Orange 0xFFAB00FF
#define Weiss 0xFFFFFFFF
#define Grau 0xDCDCDCFF
#define Gold 0xD4A017AA
#define Lila 0x7800FFFF
#define Pink 0xFF00CDFF
#define Gruen 0x009F32FF//Sonstiges
#define SCM SendClientMessage
#define SCMToAll SendClientMessageToAll
new fmex[128];
#define SCMToAllF(%0,%1,%2) format(fmex,128,%1,%2) && SendClientMessageToAll(%0, fmex)
#define SCMF(%0,%1,%2) format(fmex,128,%2) && SendClientMessage(%0,%1,fmex)//Enums
enum EEvent
{
Float:ex,
Float:ey,
Float:ez,
EventStart,
Waffe,
Schuss,
Float:Leben,
Float:Armour,
Fahrzeug,
sCP
};
new Event[EEvent];new Waffen[MAX_PLAYERS][2],
CP[MAX_PLAYERS],
CPI[50],
Float:CPX[50],
Float:CPY[50],
Float:CPZ[50],
Float:ox[MAX_PLAYERS],
Float:oy[MAX_PLAYERS],
Float:oz[MAX_PLAYERS],
EventVeh[MAX_PLAYERS],
OnEvent[MAX_PLAYERS];new VehName[][] =
{
"Landstalker", "Bravura", "Buffalo", "Linerunner", "Perrenial", "Sentinel",
"Dumper", "Firetruck", "Trashmaster", "Stretch", "Manana", "Infernus",
"Voodoo", "Pony", "Mule", "Cheetah", "Ambulance", "Leviathan", "Moonbeam",
"Esperanto", "Taxi", "Washington", "Bobcat", "Whoopee", "BF Injection",
"Hunter", "Premier", "Enforcer", "Securicar", "Banshee", "Predator", "Bus",
"Rhino", "Barracks", "Hotknife", "Trailer", "Previon", "Coach", "Cabbie",
"Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", "Admiral",
"Squalo", "Seasparrow", "Pizzaboy", "Tram", "Trailer", "Turismo", "Speeder",
"Reefer", "Tropic", "Flatbed", "Yankee", "Caddy", "Solair", "Berkley's RC Van",
"Skimmer", "PCJ-600", "Faggio", "Freeway", "RC Baron", "RC Raider", "Glendale",
"Oceanic","Sanchez", "Sparrow", "Patriot", "Quad", "Coastguard", "Dinghy",
"Hermes", "Sabre", "Rustler", "ZR-350", "Walton", "Regina", "Comet", "BMX",
"Burrito", "Camper", "Marquis", "Baggage", "Dozer", "Maverick", "News Chopper",
"Rancher", "FBI Rancher", "Virgo", "Greenwood", "Jetmax", "Hotring", "Sandking",
"Blista Compact", "Police Maverick", "Boxville", "Benson", "Mesa", "RC Goblin",
"Hotring Racer A", "Hotring Racer B", "Bloodring Banger", "Rancher", "Super GT",
"Elegant", "Journey", "Bike", "Mountain Bike", "Beagle", "Cropduster", "Stunt",
"Tanker", "Roadtrain", "Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra",
"FCR-900", "NRG-500", "HPV1000", "Cement Truck", "Tow Truck", "Fortune",
"Cadrona", "FBI Truck", "Willard", "Forklift", "Tractor", "Combine", "Feltzer",
"Remington", "Slamvan", "Blade", "Freight", "Streak", "Vortex", "Vincent",
"Bullet", "Clover", "Sadler", "Firetruck", "Hustler", "Intruder", "Primo",
"Cargobob", "Tampa", "Sunrise", "Merit", "Utility", "Nevada", "Yosemite",
"Windsor", "Monster", "Monster", "Uranus", "Jester", "Sultan", "Stratium",
"Elegy", "Raindance", "RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito",
"Freight Flat", "Streak Carriage", "Kart", "Mower", "Dune", "Sweeper",
"Broadway", "Tornado", "AT-400", "DFT-30", "Huntley", "Stafford", "BF-400",
"News Van", "Tug", "Trailer", "Emperor", "Wayfarer", "Euros", "Hotdog", "Club",
"Freight Box", "Trailer", "Andromada", "Dodo", "RC Cam", "Launch", "Police Car",
"Police Car", "Police Car", "Police Ranger", "Picador", "S.W.A.T", "Alpha",
"Phoenix", "Glendale", "Sadler", "Luggage", "Luggage", "Stairs", "Boxville",
"Tiller", "Utility Trailer"
};new
dEventManager = 5001,
dEventManager2 = 5002,
dEWaffe = 5003,
dESchuss = 5004,
dEFahrzeug = 5005,
dELeben = 5006,
dEArmour = 5007,
dECP = 5008,
dEDCP = 5009;//////////////////////////////////////
//////////////////////////////////////
//////////////////////////////////////
//////////////////////////////////////public OnFilterScriptInit()
{
print("\n--------------------------------------");
print("Eventsystem by ErikSon");
print("--------------------------------------\n");
Event[Schuss] = 1;
Event[Waffe] = 0;
Event[Fahrzeug] = 0;
Event[Leben] = 100.00;
Event[Armour] = 100.00;
for(new i = 0; i<50; i++)
{
CPX[i] = 0;
CPY[i] = 0;
CPZ[i] = 0;
CPI[i] = 0;
}
return 1;
}public OnPlayerConnect(playerid)
{
if(Event[EventStart] == 1)SCM(playerid,Blau,"**Es läuft zur Zeit ein Event. Tippe '/gotoevent', um dich zum Event zu teleportieren.");
return OnEvent[playerid] = 0;
}public OnPlayerDisconnect(playerid, reason)return OnEvent[playerid] = 0;
public OnPlayerSpawn(playerid)
{
if(OnEvent[playerid] == 1)
{
GetPlayerPos(playerid,ox[playerid],oy[playerid],oz[playerid]);
for (new i = 0; i < 13; i++)GetPlayerWeaponData(playerid, i, Waffen[playerid][0], Waffen[playerid][1]);
ResetPlayerWeapons(playerid);
SetPlayerPos(playerid,Event[ex],Event[ey],Event[ez]);
SetPlayerArmour(playerid,Event[Armour]);
SetPlayerHealth(playerid,Event[Leben]);
GivePlayerWeapon(playerid,Event[Waffe],Event[Schuss]);
EventVeh[playerid] = CreateVehicle(Event[Fahrzeug],Event[ex],Event[ey],Event[ez],-1,1,1,-1);
SetVehicleNumberPlate(EventVeh[playerid],"Event");
OnEvent[playerid] = 1;
PutPlayerInVehicle(playerid,EventVeh[playerid],0);
}
return 1;
}public OnPlayerEnterRaceCheckpoint(playerid)
{
if(IsPlayerInRangeOfPoint(playerid,7,CPX[CP[playerid]],CPY[CP[playerid]],CPZ[CP[playerid]]))
{
if(Event[sCP] != 1)return 1;
CP[playerid] ++;
if(CPI[CP[playerid]] == 0)
{
DisablePlayerRaceCheckpoint(playerid);
return SCMToAllF(Blau,"Spieler '%s' ist am Ziel angekommen!",Name(playerid));
}
else
{
if(CPI[CP[playerid]+1] == 0)return SetPlayerRaceCheckpoint(playerid,1,CPX[CP[playerid]],CPY[CP[playerid]],CPZ[CP[playerid]],CPX[CP[playerid]],CPY[CP[playerid]],CPZ[CP[playerid]],7);
else return SetPlayerRaceCheckpoint(playerid,0,CPX[CP[playerid]],CPY[CP[playerid]],CPZ[CP[playerid]],CPX[CP[playerid] +1],CPY[CP[playerid] +1],CPZ[CP[playerid] +1],7);
}
}
return 1;
}public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new i,s,w,id;
switch(dialogid)
{
case dEventManager:
{
if(response)
{
switch(listitem)
{
case 0:
{
GetPlayerPos(playerid,Event[ex],Event[ey],Event[ez]);
SCMToAll(Blau,"**Es wurde ein Event gestartet. Tippe '/gotoevent', um dich zum Event zu teleportieren.");
if(CPI[0] == 0)return Event[EventStart] = 1;
else return Event[EventStart] = 1,SCM(playerid,Blau,"Tippe '/startevent', um die Checkpoints zu aktivieren.");
}
case 1:return ShowPlayerDialog(playerid,dECP,DIALOG_STYLE_LIST,"Checkpoints - erstellen/löschen","Checkpoint erstellen\nCheckpoint löschen","Auswählen","Abbrechen");
case 2:return ShowPlayerDialog(playerid,dEFahrzeug,DIALOG_STYLE_INPUT,"Fahrzeug","Tippe die Fahrzeug-ID\ndes Fahrzeuges ein,\ndas jeder Eventteilnehmer\nerhalten soll.\n\nUm kein Fahrzeug einzustellen,\ntippe -1 ein.","Auswählen","Abbrechen");
case 3:return ShowPlayerDialog(playerid,dEWaffe,DIALOG_STYLE_INPUT,"Waffe","Tippe die Waffen-ID der Waffe ein,\ndie jeder Eventteilnehmer\nerhalten soll.\n\nUm keine Waffe einzustellen,\ntippe -1 ein.","Auswählen","Abbrechen");
case 4:return ShowPlayerDialog(playerid,dESchuss,DIALOG_STYLE_INPUT,"Munition","Tippe ein, wie viel\nMunition jeder Eventteilnehmer\nfür seine Waffe erhalten soll.\n\nUm keine Munition einzustellen,\ntippe -1 ein.","Auswählen","Abbrechen");
case 5:return ShowPlayerDialog(playerid,dELeben,DIALOG_STYLE_INPUT,"Leben","Tippe ein, wie viel Leben (HP)\njeder Eventteilnehmer erhalten soll.","Auswählen","Abbrechen");
case 6:return ShowPlayerDialog(playerid,dEArmour,DIALOG_STYLE_INPUT,"Schutzweste","Tippe ein, wie viel Schutzweste\njeder Eventteilnehmer erhalten soll.","Auswählen","Abbrechen");
}
}
}
case dECP:
{
if(response)
{
new Float:x,Float:y,Float:z;
x = 0; y = 0; z = 0;
switch(listitem)
{
case 0:
{
for(i = 0; i<50; i++)
{
GetPlayerPos(playerid,x,y,z);
id = i;
if(CPI[id] == 1)continue;
CPX[id] = x;
CPY[id] = y;
CPZ[id] = z;
CPI[id] = 1;
i += 50;SCMF(playerid,Blau,"Checkpoint (%d) wurde auf der Position '%f , %f , %f' platziert.",id,CPX[id],CPY[id],CPZ[id]);
}
}
case 1:ShowPlayerDialog(playerid,dEDCP,DIALOG_STYLE_INPUT,"Checkpoint löschen","Bitte gebe die Checkpoint-ID ein,\n die du löschen willst.\n\nUm alle Checkpoints zu löschen,\ntippe die Zahl 50 ein.","Löschen","Abbrechen");
}
}
}
case dEDCP:
{
if(response)
{
if(strval(inputtext) < 0 && strval(inputtext) > 50)return ocmd_event(playerid);
if(strval(inputtext) == 50)
{
for(i=0; i<50; i++)CPX[i] = 0,CPY[i] = 0,CPZ[i] = 0,CPI[i] = 0;
return SCM(playerid,Rot,"Du hast alle Checkpoints gelöscht.");
}
CPX[strval(inputtext)] = 0,CPY[strval(inputtext)] = 0,CPZ[strval(inputtext)] = 0, CPI[strval(inputtext)] = 0;
return SCMF(playerid,Rot,"Du hast den Checkpoint %i gelöscht.",strval(inputtext));
}
}
case dEFahrzeug:
{
if(response)
{
if(strval(inputtext) == -1)return Event[Fahrzeug] = 0, ocmd_event(playerid);
else if(!strval(inputtext))SCM(playerid,Rot,"**Bitte gebe eine Fahrzeug-ID ein!");
else if(strval(inputtext) < 400 || strval(inputtext) > 611)SCM(playerid,Rot,"**Die Fahrzeug-ID darf nicht kleiner als 400 & nicht größer als 611 sein!");
Event[Fahrzeug] = strval(inputtext);
return ocmd_event(playerid);
}
}
case dEWaffe:
{
if(response)
{
if(strval(inputtext) == -1)return Event[Waffe] = 0, ocmd_event(playerid);
else if(!strval(inputtext))SCM(playerid,Rot,"**Bitte gebe eine Waffen-ID ein!");
else if(strval(inputtext) < 0 || strval(inputtext) > 46)SCM(playerid,Rot,"**Die Waffen-ID darf nicht kleiner als 0 & nicht größer als 46 sein!");
Event[Waffe] = strval(inputtext);
return ocmd_event(playerid);
}
}
case dESchuss:
{
if(response)
{
if(!strval(inputtext))return SCM(playerid,Rot,"**Bitte gebe eine Schussmenge ein!"); ocmd_event(playerid);
Event[Schuss] = strval(inputtext);
return ocmd_event(playerid);
}
}
case dELeben:
{
if(response)
{
if(!strval(inputtext))return SCM(playerid,Rot,"**Bitte gebe eine Lebensangabe ein!"),ocmd_event(playerid);
else if(strval(inputtext) < 0)return SCM(playerid,Rot,"**Die Lebensangabe darf nicht kleiner als 0 sein!"),ocmd_event(playerid);
Event[Leben] = strval(inputtext);
return ocmd_event(playerid);
}
}
case dEArmour:
{
if(response)
{
if(!strval(inputtext))return SCM(playerid,Rot,"**Bitte gebe eine Schutzwestenangabe ein!"),ocmd_event(playerid);
else if(strval(inputtext) < 0)return SCM(playerid,Rot,"**Die Schutzwestenangabe darf nicht kleiner als 0 sein!"),ocmd_event(playerid);
Event[Armour] = strval(inputtext);
return ocmd_event(playerid);
}
}
case dEventManager2:
{
if(response)
{
switch(listitem)
{
case 0:
{
SCMToAll(Rot,"**Das Event wurde beendet.");
Event[EventStart] = 0;
Event[sCP] = 0;
for(i=0; i<MAX_PLAYERS; i++)
{
if(OnEvent[i] == 0)continue;
ResetPlayerWeapons(i);
DestroyVehicle(EventVeh[i]);
SetPlayerPos(i,ox[i],oy[i],oz[i]);
SetPlayerHealth(i,100);
SetPlayerArmour(i,0);
OnEvent[i] = 0;
for(w = 0; w<13; w++)for(s = 0; s<9999; s++)return GivePlayerWeapon(i,Waffen[i][w],Waffen[i][s]);
}
}
}
}
}
}
return 0;
}//Befehle
ocmd:gotoevent(playerid)
{
if(Event[EventStart] == 0)return SCM(playerid,Rot,"**Es läuft zur Zeit kein Event!");
GetPlayerPos(playerid,ox[playerid],oy[playerid],oz[playerid]);
for (new i = 0; i < 13; i++)GetPlayerWeaponData(playerid, i, Waffen[playerid][0], Waffen[playerid][1]);
SetPlayerPos(playerid,Event[ex],Event[ey],Event[ez]);
SetPlayerArmour(playerid,Event[Armour]);
SetPlayerHealth(playerid,Event[Leben]);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,Event[Waffe],Event[Schuss]);
EventVeh[playerid] = CreateVehicle(Event[Fahrzeug],Event[ex],Event[ey],Event[ez],-1,1,1,-1);
SetVehicleNumberPlate(EventVeh[playerid],"Event");
OnEvent[playerid] = 1;
PutPlayerInVehicle(playerid,EventVeh[playerid],0);
if(CPI[0] == 0)return 1;
CP[playerid] = 0;
if(CPI[1] == 0)return SetPlayerRaceCheckpoint(playerid,1,CPX[0],CPY[0],CPZ[0],CPX[1],CPY[1],CPZ[1],7);
else return SetPlayerRaceCheckpoint(playerid,0,CPX[0],CPY[0],CPZ[0],CPX[1],CPY[1],CPZ[1],7);
}ocmd:event(playerid)
{
if(!IsPlayerAdmin(playerid))return SCM(playerid,Rot,"**Du bist kein RCON-Admin!");
new string[144];
if(Event[Fahrzeug] == 0) {format(string,144,"Event starten\nCheckpoints\nFahrzeug: Keins\nWaffe: %s\nSchuss: %i\nLeben: %.2f\nSchutzweste: %.2f",Waffenname(Event[Waffe]),Event[Schuss],Event[Leben],Event[Armour]);}
else if(Event[Fahrzeug] != 0) {format(string,144,"Event starten\nCheckpoints\nFahrzeug: %s\nWaffe: %s\nSchuss: %i\nLeben: %.2f\nSchutzweste: %.2f",VehName[Event[Fahrzeug] -400],Waffenname(Event[Waffe]),Event[Schuss],Event[Leben],Event[Armour]);}
if(Event[EventStart] == 0)return ShowPlayerDialog(playerid,dEventManager,DIALOG_STYLE_LIST,"Eventmanager",string,"Auswählen","Abbrechen");
else if(Event[EventStart] == 1)return ShowPlayerDialog(playerid,dEventManager2,DIALOG_STYLE_LIST,"Eventmanager","Event beenden","Auswählen","Abbrechen");
return 1;
}ocmd:startevent(playerid)
{
if(!IsPlayerAdmin(playerid))return SCM(playerid,Rot,"**Du bist kein RCON-Admin!");
if(Event[sCP] != 0)return SCM(playerid,Rot,"Die Checkpoints sind schon aktiviert!");
SCMToAllF(Blau,"Admin '%s' hat die Checkpoints aktiviert!",Name(playerid));
return Event[sCP] = 1;
}//Stocks
stock Waffenname(id)
{
new wn[32];
switch(id)
{
case 0:(wn = "Faust");
case 1:(wn = "Schlagring");
case 2:(wn = "Golfschläger");
case 3:(wn = "Schlagstock");
case 4:(wn = "Messer");
case 5:(wn = "Baseballschläger");
case 6:(wn = "Schaufel");
case 7:(wn = "Billiardschläger");
case 8:(wn = "Katana");
case 9:(wn = "Kettensäge");
case 10:(wn = "Dildo");
case 11:(wn = "Dildo");
case 12:(wn = "Dildo");
case 13:(wn = "Dildo");
case 14:(wn = "Blumen");
case 15:(wn = "Stock");
case 16:(wn = "Granate");
case 17:(wn = "Rauchgranate");
case 18:(wn = "Molotov");
case 22:(wn = "9mm");
case 23:(wn = "Silencer");
case 24:(wn = "Desert Eagle");
case 25:(wn = "Shotgun");
case 26:(wn = "Sawn-off");
case 27:(wn = "Combat");
case 28:(wn = "Uzi");
case 29:(wn = "MP5");
case 30:(wn = "Ak47");
case 31:(wn = "M4");
case 32:(wn = "Tec 9");
case 33:(wn = "Gewehr");
case 34:(wn = "Sniper");
case 35:(wn = "Raketenwerfer");
case 36:(wn = "Stinger");
case 37:(wn = "Flammenwerfer");
case 38:(wn = "Minigun");
case 39:(wn = "Rucksackbomben");
case 40:(wn = "Fernzünder");
case 41:(wn = "Spray");
case 42:(wn = "Feuerlöscher");
case 43:(wn = "Kamera");
case 44:(wn = "Nachtvisier");
case 45:(wn = "Nachtvisier");
case 46:(wn = "Fallschirm");
}
return wn;
}stock Name(playerid)
{
new name[MAX_PLAYERS];
GetPlayerName(playerid,name,sizeof(name));
return name;
}//sscanf Code
stock sscanf(string[], format[], {Float,_}:...)
{
#if defined isnull
if (isnull(string))
#else
if (string[0] == 0 || (string[0] == 1 && string[1] == 0))
#endif
{
return format[0];
}
#pragma tabsize 4
new
formatPos = 0,
stringPos = 0,
paramPos = 2,
paramCount = numargs(),
delim = ' ';
while (string[stringPos] && string[stringPos] <= ' ')
{
stringPos++;
}
while (paramPos < paramCount && string[stringPos])
{
switch (format[formatPos++])
{
case '\0':
{
return 0;
}
case 'i', 'd':
{
new
neg = 1,
num = 0,
ch = string[stringPos];
if (ch == '-')
{
neg = -1;
ch = string[++stringPos];
}
do
{
stringPos++;
if ('0' <= ch <= '9')
{
num = (num * 10) + (ch - '0');
}
else
{
return -1;
}
}
while ((ch = string[stringPos]) > ' ' && ch != delim);
setarg(paramPos, 0, num * neg);
}
case 'h', 'x':
{
new
num = 0,
ch = string[stringPos];
do
{
stringPos++;
switch (ch)
{
case 'x', 'X':
{
num = 0;
continue;
}
case '0' .. '9':
{
num = (num << 4) | (ch - '0');
}
case 'a' .. 'f':
{
num = (num << 4) | (ch - ('a' - 10));
}
case 'A' .. 'F':
{
num = (num << 4) | (ch - ('A' - 10));
}
default:
{
return -1;
}
}
}
while ((ch = string[stringPos]) > ' ' && ch != delim);
setarg(paramPos, 0, num);
}
case 'c':
{
setarg(paramPos, 0, string[stringPos++]);
}
case 'f':
{new changestr[16], changepos = 0, strpos = stringPos;
while(changepos < 16 && string[strpos] && string[strpos] != delim)
{
changestr[changepos++] = string[strpos++];
}
changestr[changepos] = '\0';
setarg(paramPos,0,_:floatstr(changestr));
}
case 'p':
{
delim = format[formatPos++];
continue;
}
case '\'':
{
new
end = formatPos - 1,
ch;
while ((ch = format[++end]) && ch != '\'') {}
if (!ch)
{
return -1;
}
format[end] = '\0';
if ((ch = strfind(string, format[formatPos], false, stringPos)) == -1)
{
if (format[end + 1])
{
return -1;
}
return 0;
}
format[end] = '\'';
stringPos = ch + (end - formatPos);
formatPos = end + 1;
}
case 'u':
{
new
end = stringPos - 1,
id = 0,
bool:num = true,
ch;
while ((ch = string[++end]) && ch != delim)
{
if (num)
{
if ('0' <= ch <= '9')
{
id = (id * 10) + (ch - '0');
}
else
{
num = false;
}
}
}
if (num && IsPlayerConnected(id))
{
setarg(paramPos, 0, id);
}
else
{
#if !defined foreach
#define foreach(%1,%2) for (new %2 = 0; %2 < MAX_PLAYERS; %2++) if (IsPlayerConnected(%2))
#define __SSCANF_FOREACH__
#endif
string[end] = '\0';
num = false;
new
name[MAX_PLAYER_NAME];
id = end - stringPos;
foreach (Player, playerid)
{
GetPlayerName(playerid, name, sizeof (name));
if (!strcmp(name, string[stringPos], true, id))
{
setarg(paramPos, 0, playerid);
num = true;
break;
}
}
if (!num)
{
setarg(paramPos, 0, INVALID_PLAYER_ID);
}
string[end] = ch;
#if defined __SSCANF_FOREACH__
#undef foreach
#undef __SSCANF_FOREACH__
#endif
}
stringPos = end;
}
case 's', 'z':
{
new
i = 0,
ch;
if (format[formatPos])
{
while ((ch = string[stringPos++]) && ch != delim)
{
setarg(paramPos, i++, ch);
}
if (!i)
{
return -1;
}
}
else
{
while ((ch = string[stringPos++]))
{
setarg(paramPos, i++, ch);
}
}
stringPos--;
setarg(paramPos, i, '\0');
}
default:
{
continue;
}
}
while (string[stringPos] && string[stringPos] != delim && string[stringPos] > ' ')
{
stringPos++;
}
while (string[stringPos] && (string[stringPos] == delim || string[stringPos] <= ' '))
{
stringPos++;
}
paramPos++;
}
do
{
if ((delim = format[formatPos++]) > ' ')
{
if (delim == '\'')
{
while ((delim = format[formatPos++]) && delim != '\'') {}
}
else if (delim != 'z')
{
return delim;
}
}
}
while (delim > ' ');
return 0;
} -
Jetzt wird mir einiges klar. Danke.
-
Guten Abend,
ich habe mir ein Event FS gedownloadet und wollte dies nun verwenden als ich einen Fehler feststellen musste.
Jedes mal wenn ich /event mache öffnet sich ein Fenster, wenn ich dieses nun "Bestätige" oder "Abbreche" komme ich zu meinem Registrationssystem. Dieses sagt mir dann das mein Account nicht gefunden wurde und ich mir einen erstellen müsste. Ich vermute das das FS die selbe Dialog ID hat wie das Registrationssystem im Gamemode. Ich habe bloß keine Ahnung wo ich die Dialog ID im Fs finde. (bin erst neu beim Scripten, und muss noch einiges Lernen.)
Definiert man nicht normalerweiße die Dialog ID oben mit #define DIALOG_name ID?Filterscript:
/* Eventsystem by ErikSon */
#include <a_samp>
#include <ocmd>//Farben
#define Schwarz 0x000000FF
#define Rot 0xE10000FF
#define Gelb 0xFFE600FF
#define HBlau 0x00FFFFFF
#define DBlau 0x0000FFFF
#define Blau 0x2E9AFEFF
#define HGruen 0x00FF00FF
#define Orange 0xFFAB00FF
#define Weiss 0xFFFFFFFF
#define Grau 0xDCDCDCFF
#define Gold 0xD4A017AA
#define Lila 0x7800FFFF
#define Pink 0xFF00CDFF
#define Gruen 0x009F32FF//Sonstiges
#define SCM SendClientMessage
#define SCMToAll SendClientMessageToAll
new fmex[128];
#define SCMToAllF(%0,%1,%2) format(fmex,128,%1,%2) && SendClientMessageToAll(%0, fmex)
#define SCMF(%0,%1,%2) format(fmex,128,%2) && SendClientMessage(%0,%1,fmex)//Enums
enum EEvent
{
Float:ex,
Float:ey,
Float:ez,
EventStart,
Waffe,
Schuss,
Float:Leben,
Float:Armour,
Fahrzeug,
sCP
};
new Event[EEvent];new Waffen[MAX_PLAYERS][2],
CP[MAX_PLAYERS],
CPI[50],
Float:CPX[50],
Float:CPY[50],
Float:CPZ[50],
Float:ox[MAX_PLAYERS],
Float:oy[MAX_PLAYERS],
Float:oz[MAX_PLAYERS],
EventVeh[MAX_PLAYERS],
OnEvent[MAX_PLAYERS];new VehName[][] =
{
"Landstalker", "Bravura", "Buffalo", "Linerunner", "Perrenial", "Sentinel",
"Dumper", "Firetruck", "Trashmaster", "Stretch", "Manana", "Infernus",
"Voodoo", "Pony", "Mule", "Cheetah", "Ambulance", "Leviathan", "Moonbeam",
"Esperanto", "Taxi", "Washington", "Bobcat", "Whoopee", "BF Injection",
"Hunter", "Premier", "Enforcer", "Securicar", "Banshee", "Predator", "Bus",
"Rhino", "Barracks", "Hotknife", "Trailer", "Previon", "Coach", "Cabbie",
"Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", "Admiral",
"Squalo", "Seasparrow", "Pizzaboy", "Tram", "Trailer", "Turismo", "Speeder",
"Reefer", "Tropic", "Flatbed", "Yankee", "Caddy", "Solair", "Berkley's RC Van",
"Skimmer", "PCJ-600", "Faggio", "Freeway", "RC Baron", "RC Raider", "Glendale",
"Oceanic","Sanchez", "Sparrow", "Patriot", "Quad", "Coastguard", "Dinghy",
"Hermes", "Sabre", "Rustler", "ZR-350", "Walton", "Regina", "Comet", "BMX",
"Burrito", "Camper", "Marquis", "Baggage", "Dozer", "Maverick", "News Chopper",
"Rancher", "FBI Rancher", "Virgo", "Greenwood", "Jetmax", "Hotring", "Sandking",
"Blista Compact", "Police Maverick", "Boxville", "Benson", "Mesa", "RC Goblin",
"Hotring Racer A", "Hotring Racer B", "Bloodring Banger", "Rancher", "Super GT",
"Elegant", "Journey", "Bike", "Mountain Bike", "Beagle", "Cropduster", "Stunt",
"Tanker", "Roadtrain", "Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra",
"FCR-900", "NRG-500", "HPV1000", "Cement Truck", "Tow Truck", "Fortune",
"Cadrona", "FBI Truck", "Willard", "Forklift", "Tractor", "Combine", "Feltzer",
"Remington", "Slamvan", "Blade", "Freight", "Streak", "Vortex", "Vincent",
"Bullet", "Clover", "Sadler", "Firetruck", "Hustler", "Intruder", "Primo",
"Cargobob", "Tampa", "Sunrise", "Merit", "Utility", "Nevada", "Yosemite",
"Windsor", "Monster", "Monster", "Uranus", "Jester", "Sultan", "Stratium",
"Elegy", "Raindance", "RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito",
"Freight Flat", "Streak Carriage", "Kart", "Mower", "Dune", "Sweeper",
"Broadway", "Tornado", "AT-400", "DFT-30", "Huntley", "Stafford", "BF-400",
"News Van", "Tug", "Trailer", "Emperor", "Wayfarer", "Euros", "Hotdog", "Club",
"Freight Box", "Trailer", "Andromada", "Dodo", "RC Cam", "Launch", "Police Car",
"Police Car", "Police Car", "Police Ranger", "Picador", "S.W.A.T", "Alpha",
"Phoenix", "Glendale", "Sadler", "Luggage", "Luggage", "Stairs", "Boxville",
"Tiller", "Utility Trailer"
};enum
{
dEventManager,
dEventManager2,
dEWaffe,
dESchuss,
dEFahrzeug,
dELeben,
dEArmour,
dECP,
dEDCP
};//////////////////////////////////////
//////////////////////////////////////
//////////////////////////////////////
//////////////////////////////////////public OnFilterScriptInit()
{
print("\n--------------------------------------");
print("Eventsystem by ErikSon");
print("--------------------------------------\n");
Event[Schuss] = 1;
Event[Waffe] = 0;
Event[Fahrzeug] = 0;
Event[Leben] = 100.00;
Event[Armour] = 100.00;
for(new i = 0; i<50; i++)
{
CPX[i] = 0;
CPY[i] = 0;
CPZ[i] = 0;
CPI[i] = 0;
}
return 1;
}public OnPlayerConnect(playerid)
{
if(Event[EventStart] == 1)SCM(playerid,Blau,"**Es läuft zur Zeit ein Event. Tippe '/gotoevent', um dich zum Event zu teleportieren.");
return OnEvent[playerid] = 0;
}public OnPlayerDisconnect(playerid, reason)return OnEvent[playerid] = 0;
public OnPlayerSpawn(playerid)
{
if(OnEvent[playerid] == 1)
{
GetPlayerPos(playerid,ox[playerid],oy[playerid],oz[playerid]);
for (new i = 0; i < 13; i++)GetPlayerWeaponData(playerid, i, Waffen[playerid][0], Waffen[playerid][1]);
ResetPlayerWeapons(playerid);
SetPlayerPos(playerid,Event[ex],Event[ey],Event[ez]);
SetPlayerArmour(playerid,Event[Armour]);
SetPlayerHealth(playerid,Event[Leben]);
GivePlayerWeapon(playerid,Event[Waffe],Event[Schuss]);
EventVeh[playerid] = CreateVehicle(Event[Fahrzeug],Event[ex],Event[ey],Event[ez],-1,1,1,-1);
SetVehicleNumberPlate(EventVeh[playerid],"Event");
OnEvent[playerid] = 1;
PutPlayerInVehicle(playerid,EventVeh[playerid],0);
}
return 1;
}public OnPlayerEnterRaceCheckpoint(playerid)
{
if(IsPlayerInRangeOfPoint(playerid,7,CPX[CP[playerid]],CPY[CP[playerid]],CPZ[CP[playerid]]))
{
if(Event[sCP] != 1)return 1;
CP[playerid] ++;
if(CPI[CP[playerid]] == 0)
{
DisablePlayerRaceCheckpoint(playerid);
return SCMToAllF(Blau,"Spieler '%s' ist am Ziel angekommen!",Name(playerid));
}
else
{
if(CPI[CP[playerid]+1] == 0)return SetPlayerRaceCheckpoint(playerid,1,CPX[CP[playerid]],CPY[CP[playerid]],CPZ[CP[playerid]],CPX[CP[playerid]],CPY[CP[playerid]],CPZ[CP[playerid]],7);
else return SetPlayerRaceCheckpoint(playerid,0,CPX[CP[playerid]],CPY[CP[playerid]],CPZ[CP[playerid]],CPX[CP[playerid] +1],CPY[CP[playerid] +1],CPZ[CP[playerid] +1],7);
}
}
return 1;
}public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new i,s,w,id;
switch(dialogid)
{
case dEventManager:
{
if(response)
{
switch(listitem)
{
case 0:
{
GetPlayerPos(playerid,Event[ex],Event[ey],Event[ez]);
SCMToAll(Blau,"**Es wurde ein Event gestartet. Tippe '/gotoevent', um dich zum Event zu teleportieren.");
if(CPI[0] == 0)return Event[EventStart] = 1;
else return Event[EventStart] = 1,SCM(playerid,Blau,"Tippe '/startevent', um die Checkpoints zu aktivieren.");
}
case 1:return ShowPlayerDialog(playerid,dECP,DIALOG_STYLE_LIST,"Checkpoints - erstellen/löschen","Checkpoint erstellen\nCheckpoint löschen","Auswählen","Abbrechen");
case 2:return ShowPlayerDialog(playerid,dEFahrzeug,DIALOG_STYLE_INPUT,"Fahrzeug","Tippe die Fahrzeug-ID\ndes Fahrzeuges ein,\ndas jeder Eventteilnehmer\nerhalten soll.\n\nUm kein Fahrzeug einzustellen,\ntippe -1 ein.","Auswählen","Abbrechen");
case 3:return ShowPlayerDialog(playerid,dEWaffe,DIALOG_STYLE_INPUT,"Waffe","Tippe die Waffen-ID der Waffe ein,\ndie jeder Eventteilnehmer\nerhalten soll.\n\nUm keine Waffe einzustellen,\ntippe -1 ein.","Auswählen","Abbrechen");
case 4:return ShowPlayerDialog(playerid,dESchuss,DIALOG_STYLE_INPUT,"Munition","Tippe ein, wie viel\nMunition jeder Eventteilnehmer\nfür seine Waffe erhalten soll.\n\nUm keine Munition einzustellen,\ntippe -1 ein.","Auswählen","Abbrechen");
case 5:return ShowPlayerDialog(playerid,dELeben,DIALOG_STYLE_INPUT,"Leben","Tippe ein, wie viel Leben (HP)\njeder Eventteilnehmer erhalten soll.","Auswählen","Abbrechen");
case 6:return ShowPlayerDialog(playerid,dEArmour,DIALOG_STYLE_INPUT,"Schutzweste","Tippe ein, wie viel Schutzweste\njeder Eventteilnehmer erhalten soll.","Auswählen","Abbrechen");
}
}
}
case dECP:
{
if(response)
{
new Float:x,Float:y,Float:z;
x = 0; y = 0; z = 0;
switch(listitem)
{
case 0:
{
for(i = 0; i<50; i++)
{
GetPlayerPos(playerid,x,y,z);
id = i;
if(CPI[id] == 1)continue;
CPX[id] = x;
CPY[id] = y;
CPZ[id] = z;
CPI[id] = 1;
i += 50;SCMF(playerid,Blau,"Checkpoint (%d) wurde auf der Position '%f , %f , %f' platziert.",id,CPX[id],CPY[id],CPZ[id]);
}
}
case 1:ShowPlayerDialog(playerid,dEDCP,DIALOG_STYLE_INPUT,"Checkpoint löschen","Bitte gebe die Checkpoint-ID ein,\n die du löschen willst.\n\nUm alle Checkpoints zu löschen,\ntippe die Zahl 50 ein.","Löschen","Abbrechen");
}
}
}
case dEDCP:
{
if(response)
{
if(strval(inputtext) < 0 && strval(inputtext) > 50)return ocmd_event(playerid);
if(strval(inputtext) == 50)
{
for(i=0; i<50; i++)CPX[i] = 0,CPY[i] = 0,CPZ[i] = 0,CPI[i] = 0;
return SCM(playerid,Rot,"Du hast alle Checkpoints gelöscht.");
}
CPX[strval(inputtext)] = 0,CPY[strval(inputtext)] = 0,CPZ[strval(inputtext)] = 0, CPI[strval(inputtext)] = 0;
return SCMF(playerid,Rot,"Du hast den Checkpoint %i gelöscht.",strval(inputtext));
}
}
case dEFahrzeug:
{
if(response)
{
if(strval(inputtext) == -1)return Event[Fahrzeug] = 0, ocmd_event(playerid);
else if(!strval(inputtext))SCM(playerid,Rot,"**Bitte gebe eine Fahrzeug-ID ein!");
else if(strval(inputtext) < 400 || strval(inputtext) > 611)SCM(playerid,Rot,"**Die Fahrzeug-ID darf nicht kleiner als 400 & nicht größer als 611 sein!");
Event[Fahrzeug] = strval(inputtext);
return ocmd_event(playerid);
}
}
case dEWaffe:
{
if(response)
{
if(strval(inputtext) == -1)return Event[Waffe] = 0, ocmd_event(playerid);
else if(!strval(inputtext))SCM(playerid,Rot,"**Bitte gebe eine Waffen-ID ein!");
else if(strval(inputtext) < 0 || strval(inputtext) > 46)SCM(playerid,Rot,"**Die Waffen-ID darf nicht kleiner als 0 & nicht größer als 46 sein!");
Event[Waffe] = strval(inputtext);
return ocmd_event(playerid);
}
}
case dESchuss:
{
if(response)
{
if(!strval(inputtext))return SCM(playerid,Rot,"**Bitte gebe eine Schussmenge ein!"); ocmd_event(playerid);
Event[Schuss] = strval(inputtext);
return ocmd_event(playerid);
}
}
case dELeben:
{
if(response)
{
if(!strval(inputtext))return SCM(playerid,Rot,"**Bitte gebe eine Lebensangabe ein!"),ocmd_event(playerid);
else if(strval(inputtext) < 0)return SCM(playerid,Rot,"**Die Lebensangabe darf nicht kleiner als 0 sein!"),ocmd_event(playerid);
Event[Leben] = strval(inputtext);
return ocmd_event(playerid);
}
}
case dEArmour:
{
if(response)
{
if(!strval(inputtext))return SCM(playerid,Rot,"**Bitte gebe eine Schutzwestenangabe ein!"),ocmd_event(playerid);
else if(strval(inputtext) < 0)return SCM(playerid,Rot,"**Die Schutzwestenangabe darf nicht kleiner als 0 sein!"),ocmd_event(playerid);
Event[Armour] = strval(inputtext);
return ocmd_event(playerid);
}
}
case dEventManager2:
{
if(response)
{
switch(listitem)
{
case 0:
{
SCMToAll(Rot,"**Das Event wurde beendet.");
Event[EventStart] = 0;
Event[sCP] = 0;
for(i=0; i<MAX_PLAYERS; i++)
{
if(OnEvent[i] == 0)continue;
ResetPlayerWeapons(i);
DestroyVehicle(EventVeh[i]);
SetPlayerPos(i,ox[i],oy[i],oz[i]);
SetPlayerHealth(i,100);
SetPlayerArmour(i,0);
OnEvent[i] = 0;
for(w = 0; w<13; w++)for(s = 0; s<9999; s++)return GivePlayerWeapon(i,Waffen[i][w],Waffen[i][s]);
}
}
}
}
}
}
return 0;
}//Befehle
ocmd:gotoevent(playerid)
{
if(Event[EventStart] == 0)return SCM(playerid,Rot,"**Es läuft zur Zeit kein Event!");
GetPlayerPos(playerid,ox[playerid],oy[playerid],oz[playerid]);
for (new i = 0; i < 13; i++)GetPlayerWeaponData(playerid, i, Waffen[playerid][0], Waffen[playerid][1]);
SetPlayerPos(playerid,Event[ex],Event[ey],Event[ez]);
SetPlayerArmour(playerid,Event[Armour]);
SetPlayerHealth(playerid,Event[Leben]);
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,Event[Waffe],Event[Schuss]);
EventVeh[playerid] = CreateVehicle(Event[Fahrzeug],Event[ex],Event[ey],Event[ez],-1,1,1,-1);
SetVehicleNumberPlate(EventVeh[playerid],"Event");
OnEvent[playerid] = 1;
PutPlayerInVehicle(playerid,EventVeh[playerid],0);
if(CPI[0] == 0)return 1;
CP[playerid] = 0;
if(CPI[1] == 0)return SetPlayerRaceCheckpoint(playerid,1,CPX[0],CPY[0],CPZ[0],CPX[1],CPY[1],CPZ[1],7);
else return SetPlayerRaceCheckpoint(playerid,0,CPX[0],CPY[0],CPZ[0],CPX[1],CPY[1],CPZ[1],7);
}ocmd:event(playerid)
{
if(!IsPlayerAdmin(playerid))return SCM(playerid,Rot,"**Du bist kein RCON-Admin!");
new string[144];
if(Event[Fahrzeug] == 0) {format(string,144,"Event starten\nCheckpoints\nFahrzeug: Keins\nWaffe: %s\nSchuss: %i\nLeben: %.2f\nSchutzweste: %.2f",Waffenname(Event[Waffe]),Event[Schuss],Event[Leben],Event[Armour]);}
else if(Event[Fahrzeug] != 0) {format(string,144,"Event starten\nCheckpoints\nFahrzeug: %s\nWaffe: %s\nSchuss: %i\nLeben: %.2f\nSchutzweste: %.2f",VehName[Event[Fahrzeug] -400],Waffenname(Event[Waffe]),Event[Schuss],Event[Leben],Event[Armour]);}
if(Event[EventStart] == 0)return ShowPlayerDialog(playerid,dEventManager,DIALOG_STYLE_LIST,"Eventmanager",string,"Auswählen","Abbrechen");
else if(Event[EventStart] == 1)return ShowPlayerDialog(playerid,dEventManager2,DIALOG_STYLE_LIST,"Eventmanager","Event beenden","Auswählen","Abbrechen");
return 1;
}ocmd:startevent(playerid)
{
if(!IsPlayerAdmin(playerid))return SCM(playerid,Rot,"**Du bist kein RCON-Admin!");
if(Event[sCP] != 0)return SCM(playerid,Rot,"Die Checkpoints sind schon aktiviert!");
SCMToAllF(Blau,"Admin '%s' hat die Checkpoints aktiviert!",Name(playerid));
return Event[sCP] = 1;
}//Stocks
stock Waffenname(id)
{
new wn[32];
switch(id)
{
case 0:(wn = "Faust");
case 1:(wn = "Schlagring");
case 2:(wn = "Golfschläger");
case 3:(wn = "Schlagstock");
case 4:(wn = "Messer");
case 5:(wn = "Baseballschläger");
case 6:(wn = "Schaufel");
case 7:(wn = "Billiardschläger");
case 8:(wn = "Katana");
case 9:(wn = "Kettensäge");
case 10:(wn = "Dildo");
case 11:(wn = "Dildo");
case 12:(wn = "Dildo");
case 13:(wn = "Dildo");
case 14:(wn = "Blumen");
case 15:(wn = "Stock");
case 16:(wn = "Granate");
case 17:(wn = "Rauchgranate");
case 18:(wn = "Molotov");
case 22:(wn = "9mm");
case 23:(wn = "Silencer");
case 24:(wn = "Desert Eagle");
case 25:(wn = "Shotgun");
case 26:(wn = "Sawn-off");
case 27:(wn = "Combat");
case 28:(wn = "Uzi");
case 29:(wn = "MP5");
case 30:(wn = "Ak47");
case 31:(wn = "M4");
case 32:(wn = "Tec 9");
case 33:(wn = "Gewehr");
case 34:(wn = "Sniper");
case 35:(wn = "Raketenwerfer");
case 36:(wn = "Stinger");
case 37:(wn = "Flammenwerfer");
case 38:(wn = "Minigun");
case 39:(wn = "Rucksackbomben");
case 40:(wn = "Fernzünder");
case 41:(wn = "Spray");
case 42:(wn = "Feuerlöscher");
case 43:(wn = "Kamera");
case 44:(wn = "Nachtvisier");
case 45:(wn = "Nachtvisier");
case 46:(wn = "Fallschirm");
}
return wn;
}stock Name(playerid)
{
new name[MAX_PLAYERS];
GetPlayerName(playerid,name,sizeof(name));
return name;
}//sscanf Code
stock sscanf(string[], format[], {Float,_}:...)
{
#if defined isnull
if (isnull(string))
#else
if (string[0] == 0 || (string[0] == 1 && string[1] == 0))
#endif
{
return format[0];
}
#pragma tabsize 4
new
formatPos = 0,
stringPos = 0,
paramPos = 2,
paramCount = numargs(),
delim = ' ';
while (string[stringPos] && string[stringPos] <= ' ')
{
stringPos++;
}
while (paramPos < paramCount && string[stringPos])
{
switch (format[formatPos++])
{
case '\0':
{
return 0;
}
case 'i', 'd':
{
new
neg = 1,
num = 0,
ch = string[stringPos];
if (ch == '-')
{
neg = -1;
ch = string[++stringPos];
}
do
{
stringPos++;
if ('0' <= ch <= '9')
{
num = (num * 10) + (ch - '0');
}
else
{
return -1;
}
}
while ((ch = string[stringPos]) > ' ' && ch != delim);
setarg(paramPos, 0, num * neg);
}
case 'h', 'x':
{
new
num = 0,
ch = string[stringPos];
do
{
stringPos++;
switch (ch)
{
case 'x', 'X':
{
num = 0;
continue;
}
case '0' .. '9':
{
num = (num << 4) | (ch - '0');
}
case 'a' .. 'f':
{
num = (num << 4) | (ch - ('a' - 10));
}
case 'A' .. 'F':
{
num = (num << 4) | (ch - ('A' - 10));
}
default:
{
return -1;
}
}
}
while ((ch = string[stringPos]) > ' ' && ch != delim);
setarg(paramPos, 0, num);
}
case 'c':
{
setarg(paramPos, 0, string[stringPos++]);
}
case 'f':
{new changestr[16], changepos = 0, strpos = stringPos;
while(changepos < 16 && string[strpos] && string[strpos] != delim)
{
changestr[changepos++] = string[strpos++];
}
changestr[changepos] = '\0';
setarg(paramPos,0,_:floatstr(changestr));
}
case 'p':
{
delim = format[formatPos++];
continue;
}
case '\'':
{
new
end = formatPos - 1,
ch;
while ((ch = format[++end]) && ch != '\'') {}
if (!ch)
{
return -1;
}
format[end] = '\0';
if ((ch = strfind(string, format[formatPos], false, stringPos)) == -1)
{
if (format[end + 1])
{
return -1;
}
return 0;
}
format[end] = '\'';
stringPos = ch + (end - formatPos);
formatPos = end + 1;
}
case 'u':
{
new
end = stringPos - 1,
id = 0,
bool:num = true,
ch;
while ((ch = string[++end]) && ch != delim)
{
if (num)
{
if ('0' <= ch <= '9')
{
id = (id * 10) + (ch - '0');
}
else
{
num = false;
}
}
}
if (num && IsPlayerConnected(id))
{
setarg(paramPos, 0, id);
}
else
{
#if !defined foreach
#define foreach(%1,%2) for (new %2 = 0; %2 < MAX_PLAYERS; %2++) if (IsPlayerConnected(%2))
#define __SSCANF_FOREACH__
#endif
string[end] = '\0';
num = false;
new
name[MAX_PLAYER_NAME];
id = end - stringPos;
foreach (Player, playerid)
{
GetPlayerName(playerid, name, sizeof (name));
if (!strcmp(name, string[stringPos], true, id))
{
setarg(paramPos, 0, playerid);
num = true;
break;
}
}
if (!num)
{
setarg(paramPos, 0, INVALID_PLAYER_ID);
}
string[end] = ch;
#if defined __SSCANF_FOREACH__
#undef foreach
#undef __SSCANF_FOREACH__
#endif
}
stringPos = end;
}
case 's', 'z':
{
new
i = 0,
ch;
if (format[formatPos])
{
while ((ch = string[stringPos++]) && ch != delim)
{
setarg(paramPos, i++, ch);
}
if (!i)
{
return -1;
}
}
else
{
while ((ch = string[stringPos++]))
{
setarg(paramPos, i++, ch);
}
}
stringPos--;
setarg(paramPos, i, '\0');
}
default:
{
continue;
}
}
while (string[stringPos] && string[stringPos] != delim && string[stringPos] > ' ')
{
stringPos++;
}
while (string[stringPos] && (string[stringPos] == delim || string[stringPos] <= ' '))
{
stringPos++;
}
paramPos++;
}
do
{
if ((delim = format[formatPos++]) > ' ')
{
if (delim == '\'')
{
while ((delim = format[formatPos++]) && delim != '\'') {}
}
else if (delim != 'z')
{
return delim;
}
}
}
while (delim > ' ');
return 0;
} -
Du könntest versuchen, in der TimerFix.inc von Slice (je nach dem wie die Include bei dir heißt) das hier zu erhöhen:
#define TIMER_FIX_TIMER_SLOTS 128Setze das mal auf 256 und schaue ob der Fehler dann weg ist. Vergesse aber nicht deinen Gamemode bzw. Code neu zu kompilieren, nachdem du die Änderung gemacht hast. Die Include findest du in /pawno/includes/, ändere es dort. Anschließend öffne die pawno.exe im /pawno/ Ordner und wähle deinen Code aus, den kompilierst du dann.
Falls das nicht hilft kannst du die Include auch einfach aus deinem Gamemode raus nehmen, dann funktioniert es auf jeden Fall, die Timer sind dann eben nicht zu 100% akkurat, sondern Standard (heißt mit einer kleinen Abweichung (5 bis 10%)).
Danke hat geholfen. -
Guten Tag,
ich habe gerade in meiner Server Konsole folgende Errors gefunden:[11:30:22] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:30:55] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:31:05] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:31:22] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:31:55] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:32:05] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:32:22] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:32:55] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:33:05] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:33:22] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:33:25] [part] John_Carrey has left the server (10:1)
[11:35:20] Incoming connection: 79.876.987:7654
[11:35:21] [join] John_Carrey has joined the server (10:79.254.73.202)
[11:36:23] John_Carrey has logged in.
[11:36:55] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:37:05] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:37:21] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:37:22] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:37:55] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:38:05] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:38:21] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:38:22] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:38:55] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:39:05] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:39:21] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:39:22] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:39:55] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:40:05] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:40:21] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:40:22] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:40:55] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:41:05] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:41:21] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:41:22] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:41:55] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:42:05] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:42:21] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:42:22] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:42:55] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:43:05] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:43:21] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:43:22] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:43:55] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:44:05] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:44:21] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:44:22] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:44:55] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:45:05] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:45:21] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.
[11:45:22] (TimerFix) ERROR: The function "Minuten" didn't properly execute, some timers might not have been called.Bitte um Hilfe! Kann mit den Meldungen nichts anfangen.
-
Darauf hätte ich ja auch kommen können, manchmal sieht man den Wald vor lauter Bäumen nicht.
Danke. -
Guten Abend,
ich habe mir ein DriveIn FS gedownloadet und wollte dies nun verwenden als ich einen Fehler feststellen musste.
Jedes mal wenn ich /drivein mache öffnet sich ein Fenster, wenn ich dieses nun "Bestätige" oder "Abbreche" komme ich zu meinem Registrationssystem. Dieses sagt mir dann das mein Account nicht gefunden wurde und ich mir einen erstellen müsste. Ich habe mir nun einen neuen Acc. erstellt und es hat sich bis auf das veränderte PW von mir nichts geändert.Teil des Registrationssystems:
public OnPlayerRequestClass(playerid, classid)
{
new playersip[128];
new string[128];new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s", name);
GetPlayerIp(playerid,playersip,sizeof(playersip));
if(IsPlayerNPC(playerid))
{
SpawnPlayer(playerid);
return 1;
}
if(gPlayerAccount[playerid] == 1 && gPlayerLogged[playerid] == 0)
{
format(string,sizeof(string),"{ffffff}Nun logge dich in deinem erstellen Account von {00ff00}[{ff0000}HVR{00ff00}]{ffffff} - {00ff00}Reallife{ffffff},\nin das unterige Fenster ein:");
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"{00ff00}[{ff0000}HVR{00ff00}]{ffffff}- Account",string,"Einloggen","Abbrechen");
}
else if(gPlayerAccount[playerid] == 0 && gPlayerLogged[playerid] == 0)
{
format(string, sizeof(string),"{ffffff}=> Die Datenbank hat noch keinen Account gefunden,\n{00ff00}=>{ffffff} Bitte erstelle einen Account, indem du auf '{ff0000}Erstellen{ffffff}' klickst.",name,playersip);
ShowPlayerDialog(playerid,DIALOG_REG,DIALOG_STYLE_MSGBOX,"{00ff00}[{ff0000}HVR{00ff00}]{ffffff} - {00ff00}Registration",string,"Erstellen","Abbrechen");
}PlayerPlaySound(playerid, 1176, 0.0, 0.0, 0.0);
PlayerInfo[playerid][pModel] = Peds[classid][0];
SetPlayerTeamFromClass(playerid,classid);
SetupPlayerForClassSelection(playerid);
return 1;
}DriveIn FS:
//#define FILTERSCRIPT
/* Dieses Filterscript wurde von magnussoft aus dem Breadfish Forum entworfen.
Credits an magnussoft.
Wer nett ist lässt die Credits drinne aber wenn ihr meint es rauszunehmen könnt ihr das gerne tuhen.
Wenn ihr Verbesserungsvorschläge habt könnt ihr sie gerne im Thread posten.
Nun wünsche ich euch viel Spaß mit dem Filterscripteuer magnussoft.*/
#include <a_samp>
#define FILTERSCRIPT
#define DIALOG_Essen 1
#define ROT 0xE10000FF
forward IstErAnEinemDrivein(playerid);
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" magnussofts Drivein Script Version 0.1");
print("--------------------------------------\n");
return 1;
}public OnFilterScriptExit()
{
return 1;
}public OnGameModeInit()
{
Create3DTextLabel("Willkommen am Drivein\nUm ihre Bestellung aufnehmen zu können benutzen sie\n /drivein!",0xFFFF00AA,2375.014, 2021.186, 10.8203,15.0,0,0);
Create3DTextLabel("Willkommen am Drivein\nUm ihre Bestellung aufnehmen zu können benutzen sie\n /drivein!",0xFFFF00AA,2409.651, -1488.65, 23.8281,15.0,0,0);
Create3DTextLabel("Willkommen am Drivein\nUm ihre Bestellung aufnehmen zu können benutzen sie\n /drivein!",0xFFFF00AA,2377.733, -1909.27, 13.3828,15.0,0,0);
Create3DTextLabel("Willkommen am Drivein\nUm ihre Bestellung aufnehmen zu können benutzen sie\n /drivein!",0xFFFF00AA,1859.496, 2084.797, 10.8203,15.0,0,0);
Create3DTextLabel("Willkommen am Drivein\nUm ihre Bestellung aufnehmen zu können benutzen sie\n /drivein!",0xFFFF00AA,-2349.49, -152.182, 35.3203,15.0,0,0);
Create3DTextLabel("Willkommen am Drivein\nUm ihre Bestellung aufnehmen zu können benutzen sie\n /drivein!",0xFFFF00AA,-2341.86, 1021.184, 50.6953,15.0,0,0);
Create3DTextLabel("Willkommen am Drivein\nUm ihre Bestellung aufnehmen zu können benutzen sie\n /drivein!",0xFFFF00AA,2485.291, 2022.611, 10.8203,15.0,0,0);
Create3DTextLabel("Willkommen am Drivein\nUm ihre Bestellung aufnehmen zu können benutzen sie\n /drivein!",0xFFFF00AA,801.5522, -1628.91, 13.3828,15.0,0,0);
Create3DTextLabel("Willkommen am Drivein\nUm ihre Bestellung aufnehmen zu können benutzen sie\n /drivein!",0xFFFF00AA,1209.958,-896.7405, 42.9259,15.0,0,0);CreatePickup(1240,1,2375.014,2021.186,10);//Drivein Pickup
CreatePickup(1240,1,2377.733,-1909.27,13.3828);//Drivein Pickup
CreatePickup(1240,1,1859.496,2084.797,10.8203);//Drivein Pickup
CreatePickup(1240,1,-2349.49,-152.182,35);//Drivein Pickup
CreatePickup(1240,1,-2341.86,1021.184,50.6953);//Drivein Pickup
CreatePickup(1240,1,2485.291, 2022.611,10.8203);//Drivein Pickup
CreatePickup(1240,1,801.5522,-1628.91, 13.3828);//Drivein Pickup
CreatePickup(1240,1,1209.958,-896.7405,42.9259);//Drivein Pickup
// Don't use these lines if it's a filterscript
return 1;
}public OnGameModeExit()
{
return 1;
}public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}public OnPlayerConnect(playerid)
{
return 1;
}public OnPlayerDisconnect(playerid, reason)
{
return 1;
}public OnPlayerSpawn(playerid)
{
return 1;
}public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}public OnVehicleSpawn(vehicleid)
{
return 1;
}public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}public OnPlayerText(playerid, text[])
{
return 1;
}public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/Drivein", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IstErAnEinemDrivein(playerid))
{
ShowPlayerDialog(playerid,DIALOG_Essen, DIALOG_STYLE_LIST, "Willkommen im Drivein\n Bitte geben sie ihre Bestellung auf", "Cheesburger\nMcWraps\n Big Mac", "Weiter", "Schließen");
}
else
{
SendClientMessage(playerid, ROT, "Du bist an keinem Drivein !");
return 1;
}
}
return 1;
}
return 0;
}public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}public OnRconCommand(cmd[])
{
return 1;
}public OnPlayerRequestSpawn(playerid)
{
return 1;
}public OnObjectMoved(objectid)
{
return 1;
}public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}public OnPlayerExitedMenu(playerid)
{
return 1;
}public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}public OnPlayerUpdate(playerid)
{
return 1;
}public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid==DIALOG_Essen)
{
if(response)
switch(listitem)
{
case 0:
{
if(GetPlayerMoney(playerid)<200) return SendClientMessage(playerid,ROT,"Du hast zu wenig Geld dabei!");
{
new Float:Leben;
GetPlayerHealth(playerid,Leben);
SetPlayerHealth(playerid,Leben +50);
SendClientMessage(playerid, ROT, "Du hast den Cheesburger genommen!.");
GivePlayerMoney(playerid,-200);
GameTextForPlayer(playerid, "~r~ -200$", 3000, 1);
}
}
case 1:
{
if(GetPlayerMoney(playerid)<300) return SendClientMessage(playerid,ROT,"Du hast zu wenig Geld dabei!");
{
new Float:Leben;
GetPlayerHealth(playerid,Leben);
SetPlayerHealth(playerid,Leben +80);
SendClientMessage(playerid, ROT, "Du hast den McWrap genommen!.");
GivePlayerMoney(playerid,-300);
GameTextForPlayer(playerid, "~r~ -300$", 3000, 1);
}
}
case 2:
{
if(GetPlayerMoney(playerid)<400) return SendClientMessage(playerid,ROT,"Du hast zu wenig Geld dabei!");
{
new Float:Leben;
GetPlayerHealth(playerid,Leben);
SetPlayerHealth(playerid,Leben +100);
SendClientMessage(playerid, ROT, "Du hast den Big Mac genommen!.");
GivePlayerMoney(playerid,-400);
GameTextForPlayer(playerid, "~r~ -400$", 3000, 1);
}
}
}
return 1;
}
return 1;
}public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
public IstErAnEinemDrivein(playerid)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInRangeOfPoint(playerid,10.0,801.5522, -1628.91, 13.3828) || IsPlayerInRangeOfPoint(playerid,10.0,1209.958,-896.7405, 42.9259))
{
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,10.0,-2341.86, 1021.184, 50.6953) || IsPlayerInRangeOfPoint(playerid,10.0,2485.291, 2022.611, 10.8203))
{
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,10.0,1859.496, 2084.797, 10.8203) || IsPlayerInRangeOfPoint(playerid,10.0,-2349.49, -152.182, 35.3203))
{
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,10.0,2409.651, -1488.65, 23.8281) || IsPlayerInRangeOfPoint(playerid,10.0,2377.733, -1909.27, 13.3828))
{
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,10.0,2375.014, 2021.186, 10.8203))
{
return 1;
}
}
return 0;
} -
-
Guten Tag,
ich habe mir das FS worum es sich hier handelt aus dem Netzt gezogen da ich noch ein blutiger Anfänger bin was Sachen Scripting betrifft.
Nun meine Frage, ich möchte gern das in dem gezeigten FS alle Chatausgaben die der Spieler bekommt so sind wie oben Definiert.FS:
#include <a_samp>
#include <ocmd>#define MAX_ROADBLOCKS 50
#define blue 0xAA3333AAnew RB[MAX_ROADBLOCKS];
new bool:IsRBC[MAX_ROADBLOCKS];public OnFilterScriptInit()
{
print("\nRoadblock Filterscript by Gredsoft\n");for(new i = 0; i < MAX_ROADBLOCKS; i++)
{
IsRBC[i] = false;
DestroyObject(RB[i]);
}return 1;
}public OnFilterScriptExit()
{
for(new i = 0; i < MAX_ROADBLOCKS; i++)
{
IsRBC[i] = false;
DestroyObject(RB[i]);
}
}ocmd:ssc(playerid,params[])
{
new skin;
skin = GetPlayerSkin(playerid);
if(skin < 280 || skin > 288)return SendClientMessage(playerid,-1,"Du bist kein Polizist!");new Float:x,Float:y,Float:z,Float:a;
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,a);for(new i = 0; i < MAX_ROADBLOCKS; i++)
{
if(!IsRBC[i]) {
IsRBC[i] = true;
RB[i] = CreateObject(978,x,y,z - 0.6,0.0,0.0,a -180.0);
for(new i2 = 0; i2 < MAX_PLAYERS; i2++)
{
new iskin;
iskin = GetPlayerSkin(i2);
if(iskin > 279 && iskin < 289){
new str[128];
format(str,sizeof(str),"[HQ] Polizist %s hat eine Straßensperre aufgestellt!",ReturnPlayerName(playerid));
SendClientMessage(i2,-1,str);
}
}
return 1;
}
}
SendClientMessage(playerid,-1,"[HQ] Es können keine weiteren Straßensperren mehr aufgestellt werden.");
SendClientMessage(playerid,-1,"[HQ] Möglichkeiten: /ssa | /ssd (Nummer)");
return 1;
}
ocmd:ssd(playerid,params[])
{
new skin;
skin = GetPlayerSkin(playerid);
if(skin < 280 || skin > 288)return SendClientMessage(playerid,-1,"[HQ] Du bist kein Polizist!");new rbid;
if(sscanf(params,"i",rbid))return SendClientMessage(playerid,-1,"[HQ] Benutzung: /ssd <ID>");
if(!IsRBC[rbid])return SendClientMessage(playerid,-1,"[HQ] Es existiert keine Straßensperre unter dieser ID.");
DestroyObject(RB[rbid]);
IsRBC[rbid] = false;
for(new i = 0; i < MAX_PLAYERS; i++)
{
new iskin;
iskin = GetPlayerSkin(i);
if(iskin > 279 && iskin < 289){
new str[128];
format(str,sizeof(str),"[HQ] Polizist %s hat die Straßensperre mit der ID %i entfernt!",ReturnPlayerName(playerid),rbid);
SendClientMessage(i,-1,str);
}
}
return 1;
}
ocmd:ssa(playerid,params[])
{
new skin;
skin = GetPlayerSkin(playerid);
if(skin < 280 || skin > 288)return SendClientMessage(playerid,-1,"[HQ] Du bist kein Polizist!");for(new i = 0; i < MAX_ROADBLOCKS; i++)
{
IsRBC[i] = false;
DestroyObject(RB[i]);
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
new iskin;
iskin = GetPlayerSkin(i);
if(iskin > 279 && iskin < 289){
new str[128];
format(str,sizeof(str),"[HQ] Polizist %s hat alle Straßensperren entfernt!",ReturnPlayerName(playerid));
SendClientMessage(i,-1,str);
}
}
return 1;
}stock ReturnPlayerName(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
return name;
}stock sscanf(string[], format[], {Float,_}:...)
{
#if defined isnull
if (isnull(string))
#else
if (string[0] == 0 || (string[0] == 1 && string[1] == 0))
#endif
{
return format[0];
}
#pragma tabsize 4
new
formatPos = 0,
stringPos = 0,
paramPos = 2,
paramCount = numargs(),
delim = ' ';
while (string[stringPos] && string[stringPos] <= ' ')
{
stringPos++;
}
while (paramPos < paramCount && string[stringPos])
{
switch (format[formatPos++])
{
case '\0':
{
return 0;
}
case 'i', 'd':
{
new
neg = 1,
num = 0,
ch = string[stringPos];
if (ch == '-')
{
neg = -1;
ch = string[++stringPos];
}
do
{
stringPos++;
if ('0' <= ch <= '9')
{
num = (num * 10) + (ch - '0');
}
else
{
return -1;
}
}
while ((ch = string[stringPos]) > ' ' && ch != delim);
setarg(paramPos, 0, num * neg);
}
case 'h', 'x':
{
new
num = 0,
ch = string[stringPos];
do
{
stringPos++;
switch (ch)
{
case 'x', 'X':
{
num = 0;
continue;
}
case '0' .. '9':
{
num = (num << 4) | (ch - '0');
}
case 'a' .. 'f':
{
num = (num << 4) | (ch - ('a' - 10));
}
case 'A' .. 'F':
{
num = (num << 4) | (ch - ('A' - 10));
}
default:
{
return -1;
}
}
}
while ((ch = string[stringPos]) > ' ' && ch != delim);
setarg(paramPos, 0, num);
}
case 'c':
{
setarg(paramPos, 0, string[stringPos++]);
}
case 'f':
{new changestr[16], changepos = 0, strpos = stringPos;
while(changepos < 16 && string[strpos] && string[strpos] != delim)
{
changestr[changepos++] = string[strpos++];
}
changestr[changepos] = '\0';
setarg(paramPos,0,_:floatstr(changestr));
}
case 'p':
{
delim = format[formatPos++];
continue;
}
case '\'':
{
new
end = formatPos - 1,
ch;
while ((ch = format[++end]) && ch != '\'') {}
if (!ch)
{
return -1;
}
format[end] = '\0';
if ((ch = strfind(string, format[formatPos], false, stringPos)) == -1)
{
if (format[end + 1])
{
return -1;
}
return 0;
}
format[end] = '\'';
stringPos = ch + (end - formatPos);
formatPos = end + 1;
}
case 'u':
{
new
end = stringPos - 1,
id = 0,
bool:num = true,
ch;
while ((ch = string[++end]) && ch != delim)
{
if (num)
{
if ('0' <= ch <= '9')
{
id = (id * 10) + (ch - '0');
}
else
{
num = false;
}
}
}
if (num && IsPlayerConnected(id))
{
setarg(paramPos, 0, id);
}
else
{
#if !defined foreach
#define foreach(%1,%2) for (new %2 = 0; %2 < MAX_PLAYERS; %2++) if (IsPlayerConnected(%2))
#define __SSCANF_FOREACH__
#endif
string[end] = '\0';
num = false;
new
name[MAX_PLAYER_NAME];
id = end - stringPos;
foreach (Player, playerid)
{
GetPlayerName(playerid, name, sizeof (name));
if (!strcmp(name, string[stringPos], true, id))
{
setarg(paramPos, 0, playerid);
num = true;
break;
}
}
if (!num)
{
setarg(paramPos, 0, INVALID_PLAYER_ID);
}
string[end] = ch;
#if defined __SSCANF_FOREACH__
#undef foreach
#undef __SSCANF_FOREACH__
#endif
}
stringPos = end;
}
case 's', 'z':
{
new
i = 0,
ch;
if (format[formatPos])
{
while ((ch = string[stringPos++]) && ch != delim)
{
setarg(paramPos, i++, ch);
}
if (!i)
{
return -1;
}
}
else
{
while ((ch = string[stringPos++]))
{
setarg(paramPos, i++, ch);
}
}
stringPos--;
setarg(paramPos, i, '\0');
}
default:
{
continue;
}
}
while (string[stringPos] && string[stringPos] != delim && string[stringPos] > ' ')
{
stringPos++;
}
while (string[stringPos] && (string[stringPos] == delim || string[stringPos] <= ' '))
{
stringPos++;
}
paramPos++;
}
do
{
if ((delim = format[formatPos++]) > ' ')
{
if (delim == '\'')
{
while ((delim = format[formatPos++]) && delim != '\'') {}
}
else if (delim != 'z')
{
return delim;
}
}
}
while (delim > ' ');
return 0;
} -
Dank Dir. Machst hier einen Super Job
-
Guten Abend,
ich habe ein problem mit meinem FS.Bevor ich das FS eingefügt habe ging alles super, als ich es jedoch einfügte geht zwar das FS aber alle anderen Commands fallen aus.
Bitte um Hilfe.
Vielen Dank im Voraus!Filterscript:
//#define FILTERSCRIPT
/* Dieses Filterscript wurde von magnussoft aus dem Breadfish Forum entworfen.
Credits an magnussoft.
Wer nett ist lässt die Credits drinne aber wenn ihr meint es rauszunehmen könnt ihr das gerne tuhen.
Wenn ihr Verbesserungsvorschläge habt könnt ihr sie gerne im Thread posten.
Nun wünsche ich euch viel Spaß mit dem Filterscripteuer magnussoft.*/
#include <a_samp>
#define FILTERSCRIPT
#define DIALOG_Essen 1
#define ROT 0xE10000FF
forward IstErAnEinemDrivein(playerid);
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" magnussofts Drivein Script Version 0.1");
print("--------------------------------------\n");
return 1;
}public OnFilterScriptExit()
{
return 1;
}public OnGameModeInit()
{
Create3DTextLabel("Willkommen am Drivein\nUm ihre Bestellung aufnehmen zu können benutzen sie\n /drivein!",0xFFFF00AA,2375.014, 2021.186, 10.8203,15.0,0,0);
Create3DTextLabel("Willkommen am Drivein\nUm ihre Bestellung aufnehmen zu können benutzen sie\n /drivein!",0xFFFF00AA,2409.651, -1488.65, 23.8281,15.0,0,0);
Create3DTextLabel("Willkommen am Drivein\nUm ihre Bestellung aufnehmen zu können benutzen sie\n /drivein!",0xFFFF00AA,2377.733, -1909.27, 13.3828,15.0,0,0);
Create3DTextLabel("Willkommen am Drivein\nUm ihre Bestellung aufnehmen zu können benutzen sie\n /drivein!",0xFFFF00AA,1859.496, 2084.797, 10.8203,15.0,0,0);
Create3DTextLabel("Willkommen am Drivein\nUm ihre Bestellung aufnehmen zu können benutzen sie\n /drivein!",0xFFFF00AA,-2349.49, -152.182, 35.3203,15.0,0,0);
Create3DTextLabel("Willkommen am Drivein\nUm ihre Bestellung aufnehmen zu können benutzen sie\n /drivein!",0xFFFF00AA,-2341.86, 1021.184, 50.6953,15.0,0,0);
Create3DTextLabel("Willkommen am Drivein\nUm ihre Bestellung aufnehmen zu können benutzen sie\n /drivein!",0xFFFF00AA,2485.291, 2022.611, 10.8203,15.0,0,0);
Create3DTextLabel("Willkommen am Drivein\nUm ihre Bestellung aufnehmen zu können benutzen sie\n /drivein!",0xFFFF00AA,801.5522, -1628.91, 13.3828,15.0,0,0);
Create3DTextLabel("Willkommen am Drivein\nUm ihre Bestellung aufnehmen zu können benutzen sie\n /drivein!",0xFFFF00AA,1209.958,-896.7405, 42.9259,15.0,0,0);CreatePickup(1240,1,2375.014,2021.186,10);//Drivein Pickup
CreatePickup(1240,1,2377.733,-1909.27,13.3828);//Drivein Pickup
CreatePickup(1240,1,1859.496,2084.797,10.8203);//Drivein Pickup
CreatePickup(1240,1,-2349.49,-152.182,35);//Drivein Pickup
CreatePickup(1240,1,-2341.86,1021.184,50.6953);//Drivein Pickup
CreatePickup(1240,1,2485.291, 2022.611,10.8203);//Drivein Pickup
CreatePickup(1240,1,801.5522,-1628.91, 13.3828);//Drivein Pickup
CreatePickup(1240,1,1209.958,-896.7405,42.9259);//Drivein Pickup
// Don't use these lines if it's a filterscript
return 1;
}public OnGameModeExit()
{
return 1;
}public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}public OnPlayerConnect(playerid)
{
return 1;
}public OnPlayerDisconnect(playerid, reason)
{
return 1;
}public OnPlayerSpawn(playerid)
{
return 1;
}public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}public OnVehicleSpawn(vehicleid)
{
return 1;
}public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}public OnPlayerText(playerid, text[])
{
return 1;
}public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/Drivein", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IstErAnEinemDrivein(playerid))
{
ShowPlayerDialog(playerid,DIALOG_Essen, DIALOG_STYLE_LIST, "Willkommen im Drivein\n Bitte geben sie ihre Bestellung auf", "Cheesburger\nMcWraps\n Big Mac", "Weiter", "Schließen");
}
else
{
SendClientMessage(playerid, ROT, "Du bist an keinem Drivein !");
return 1;
}
}
return 0;
}
return 1;
}public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}public OnRconCommand(cmd[])
{
return 1;
}public OnPlayerRequestSpawn(playerid)
{
return 1;
}public OnObjectMoved(objectid)
{
return 1;
}public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}public OnPlayerExitedMenu(playerid)
{
return 1;
}public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}public OnPlayerUpdate(playerid)
{
return 1;
}public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid==DIALOG_Essen)
{
if(response)
switch(listitem)
{
case 0:
{
if(GetPlayerMoney(playerid)<200) return SendClientMessage(playerid,ROT,"Du hast zu wenig Geld dabei!");
{
new Float:Leben;
GetPlayerHealth(playerid,Leben);
SetPlayerHealth(playerid,Leben +50);
SendClientMessage(playerid, ROT, "Du hast den Cheesburger genommen!.");
GivePlayerMoney(playerid,-200);
GameTextForPlayer(playerid, "~r~ -200$", 3000, 1);
}
}
case 1:
{
if(GetPlayerMoney(playerid)<300) return SendClientMessage(playerid,ROT,"Du hast zu wenig Geld dabei!");
{
new Float:Leben;
GetPlayerHealth(playerid,Leben);
SetPlayerHealth(playerid,Leben +80);
SendClientMessage(playerid, ROT, "Du hast den McWrap genommen!.");
GivePlayerMoney(playerid,-300);
GameTextForPlayer(playerid, "~r~ -300$", 3000, 1);
}
}
case 2:
{
if(GetPlayerMoney(playerid)<400) return SendClientMessage(playerid,ROT,"Du hast zu wenig Geld dabei!");
{
new Float:Leben;
GetPlayerHealth(playerid,Leben);
SetPlayerHealth(playerid,Leben +100);
SendClientMessage(playerid, ROT, "Du hast den Big Mac genommen!.");
GivePlayerMoney(playerid,-400);
GameTextForPlayer(playerid, "~r~ -400$", 3000, 1);
}
}
}
return 1;
}
return 1;
}public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
public IstErAnEinemDrivein(playerid)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInRangeOfPoint(playerid,10.0,801.5522, -1628.91, 13.3828) || IsPlayerInRangeOfPoint(playerid,10.0,1209.958,-896.7405, 42.9259))
{
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,10.0,-2341.86, 1021.184, 50.6953) || IsPlayerInRangeOfPoint(playerid,10.0,2485.291, 2022.611, 10.8203))
{
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,10.0,1859.496, 2084.797, 10.8203) || IsPlayerInRangeOfPoint(playerid,10.0,-2349.49, -152.182, 35.3203))
{
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,10.0,2409.651, -1488.65, 23.8281) || IsPlayerInRangeOfPoint(playerid,10.0,2377.733, -1909.27, 13.3828))
{
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,10.0,2375.014, 2021.186, 10.8203))
{
return 1;
}
}
return 0;
} -
Guten Tag,
ich habe ein Prolem mit einem Herruntergeladenem Script.
Ich wollte im Script den Preis beiner Bizz ändern schaute in die .cfg Datei und da stand das.
Da ich mich nicht besonders mit Scripting auskenne bitte ich nun hier um Hilfe.
Vielen Dank im Vorraus.0||||0.000000|0.000000|0.000000|0|0|0|0|0|0|0|0|0
0||||0.000000|0.000000|0.000000|0|0|0|0|0|0|0|0|0
0||||0.000000|0.000000|0.000000|0|0|0|0|0|0|0|0|0
0||||0.000000|0.000000|0.000000|0|0|0|0|0|0|0|0|0
0||||0.000000|0.000000|0.000000|0|0|0|0|0|0|0|0|0
0||||0.000000|0.000000|0.000000|0|0|0|0|0|0|0|0|0
0||||0.000000|0.000000|0.000000|0|0|0|0|0|0|0|0|0
0||||0.000000|0.000000|0.000000|0|0|0|0|0|0|0|0|0
0||||0.000000|0.000000|0.000000|0|0|0|0|0|0|0|0|0
0||||0.000000|0.000000|0.000000|0|0|0|0|0|0|0|0|0
0||||0.000000|0.000000|0.000000|0|0|0|0|0|0|0|0|0
0||||0.000000|0.000000|0.000000|0|0|0|0|0|0|0|0|0
0||||0.000000|0.000000|0.000000|0|0|0|32000|0|0|0|0|0
0||||0.000000|0.000000|0.000000|0|0|0|0|0|0|0|0|0
0||||0.000000|0.000000|0.000000|0|0|0|0|0|0|0|0|0
0||||0.000000|0.000000|0.000000|0|0|0|0|0|0|0|0|0
0||||0.000000|0.000000|0.000000|0|0|0|0|0|0|0|0|0
0||||0.000000|0.000000|0.000000|0|0|0|0|0|0|0|0|0
0||||0.000000|0.000000|0.000000|0|0|0|0|0|0|0|0|0
0||||0.000000|0.000000|0.000000|0|0|0|0|0|0|0|0|0
0||||0.000000|0.000000|0.000000|0|0|0|0|0|0|0|0|0
0||||0.000000|0.000000|0.000000|0|0|0|0|0|0|0|0|0 -
Guten Tag,
ich habe mir ein Script gedownloadet weil ich ein Anfänger im Thema Scripting bin.
Nun meine Frage: Wo kann ich den Preis für eine Bootsfahrt festlegen?for(new v=0; v<sizeof(HafenKlause); v++)
{
if(newcar == HafenKlause[v])
{
new cost = SBizzInfo[1][sbEntranceCost];
if(GetPlayerMoney(playerid) >= cost)
{
GivePlayerMoney(playerid,-cost);
SBizzInfo[1][sbTill] += cost;
format(string,sizeof(string),"Bootsfahrt:Du zahlst $%d",cost);
SendClientMessage(playerid,COLOR_WHITE,string);
//GameTextForPlayer(playerid,string,5000,3);
}
else
{
format(string,sizeof(string)," Die Bootsfahrt kostet $%d. Du hast nicht soviel!",cost);
SendClientMessage(playerid,COLOR_WHITE,string);
RemovePlayerFromVehicle(playerid);
}
return 1;
}
}