Hilfe für Einsteins Object Streamer!!!

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Also ich habe Einsteins Object streamer in den include ordner getan, aber ich bekomme die errors! Muss ich da noch was in die server.cfg eintragen?


    dazu die Linien....ich habe auch ein waffen-kauf-system gemacht, da könntet ihr mir auch mal bisschen helfen, wenns ginge, aber das hauptproblem ist das mit den streamer...




    #include <a_samp>
    #include <dini>



    #include <Obj_Streamer>


    #pragma tabsize 0



    #define BLAU 0x000FFFFF
    #define ORANGE 0xFFB400FF
    #define PINK 0xFF00CDFF
    #define GRÜN 0x416C00FF
    #define BRAUN 0x550000FF
    #define ROT 0xEB0000FF
    #define GELB 0xE1E400FF



    #define shop 1
    #define DIALOG_LOGIN 3
    #define DIALOG_REG 4



    #define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0)&& (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1


    enum spieler_daten
    {
    money,
    score,
    wanted,
    skin,
    Float:lastx,Float:lasty,Float:lastz,
    eingeloggt
    }


    new Spieler[MAX_PLAYERS][spieler_daten];



    public OnFilterScriptInit()
    {
    print("\n--------------------------------------");
    print(" TestServer");
    print("--------------------------------------\n");
    return 1;
    }


    public OnFilterScriptExit()
    {
    return 1;
    }



    main()
    {
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
    }



    public OnGameModeInit()
    {
    SetGameModeText("TestMode");
    ShowPlayerMarkers(0);
    AddPlayerClass(0,1108.7648,-1796.8116,16.5938,85.2672,24,1000,25,500,29,2000);
    AddPlayerClass(1,1108.7648,-1796.8116,16.5938,85.2672,24,1000,25,500,29,2000);
    AddPlayerClass(2,1108.7648,-1796.8116,16.5938,85.2672,24,1000,25,500,29,2000);
    AddPlayerClass(3,1108.7648,-1796.8116,16.5938,85.2672,24,1000,25,500,29,2000);
    // geht noch weiter



    AddStaticVehicle(411,1062.6051,-1772.9451,13.0812,270.2808,123,1); //infernus spawn
    AddStaticVehicle(411,1079.7968,-1772.6218,13.0780,270.8197,123,1); //infernus2 spawn
    AddStaticVehicle(451,1853.0966,-2356.5967,13.2533,249.5652,36,36); // turismo 1 in ls airport
    //geht noch weiter


    return 1;
    }


    public OnGameModeInit()
    {
    StreamObject_OnGameModeInit();
    CreateObjectToStream(17594, 3540.839600, -1954.661377, 7.729668, 0.0000, 0.0000, 101.2500);
    CreateObjectToStream(4842, 3472.531738, -1944.301392, -2.102670, 0.0000, 0.0000, 303.7500);
    CreateObjectToStream(4842, 3528.864258, -2072.637695, -2.074038, 0.0000, 0.0000, 337.5000);
    //geht noch weiter
    return 1;
    }


    10000 zeichen überschritten...

  • public OnGameModeExit()
    {
    StreamObject_OnGameModeExit();
    return 1;
    }


    public OnPlayerRequestClass(playerid, classid)
    {
    SetPlayerPos(playerid,1108.7648,-1796.8116,16.5938);
    SetPlayerFacingAngle(playerid,16.5938);
    SetPlayerCameraPos(playerid,1105.2102,-1796.1521,16.0481);
    SetPlayerCameraLookAt(playerid,1108.7648,-1796.8116,16.5938);
    return 1;
    }


    public OnPlayerConnect(playerid)


    {
    new pname[MAX_PLAYERS],accFormat[128];
    GetPlayerName(playerid,pname,sizeof pname);
    format(accFormat,sizeof accFormat,"%s.datei",pname);
    if(fexist(accFormat))
    {
    ShowPlayerDialog(playerid,DIALOG_LOGIN,1,"Login","Bitte logge dich ein","Weiter","Abbrechen");
    }
    else
    {
    ShowPlayerDialog(playerid,DIALOG_REG,1,"Registrieren","Bitte Registriere dich","Weiter","Abbrechen");
    }
    GivePlayerMoney(playerid,dini_Int(accFormat,"money"));
    return 1;
    }


    public OnPlayerDisconnect(playerid, reason)
    {
    {
    new pname[MAX_PLAYERS],accFormat[128];
    GetPlayerName(playerid,pname,sizeof pname);
    format(accFormat,sizeof accFormat,"%s.datei",pname);
    if(fexist(accFormat) && Spieler[playerid][eingeloggt])
    {
    Spieler[playerid][money] = GetPlayerMoney(playerid);
    Spieler[playerid][score] = GetPlayerScore(playerid);
    dini_IntSet(accFormat,"money",GetPlayerMoney(playerid));
    dini_IntSet(accFormat,"score",Spieler[playerid][score]);
    dini_IntSet(accFormat,"wanted",Spieler[playerid][wanted]);
    dini_IntSet(accFormat,"skin",Spieler[playerid][skin]);
    dini_FloatSet(accFormat,"lastx",Spieler[playerid][lastx]);
    dini_FloatSet(accFormat,"lasty",Spieler[playerid][lasty]);
    dini_FloatSet(accFormat,"lastz",Spieler[playerid][lastz]);
    }
    Spieler[playerid][eingeloggt] = 0;
    Spieler[playerid][money] = 0;
    Spieler[playerid][score] = 0;
    Spieler[playerid][wanted] = 0;
    Spieler[playerid][skin] = 0;
    Spieler[playerid][lastx] = (0.0);
    Spieler[playerid][lasty] = (0.0);
    Spieler[playerid][lastz] = (0.0);
    }
    new pname[MAX_PLAYERS],accFormat[128];
    GetPlayerName(playerid,pname,sizeof pname);
    format(accFormat,sizeof accFormat,"%s.datei",pname);
    dini_IntSet(accFormat,"money",GetPlayerMoney(playerid));
    return 1;
    }



    public OnPlayerSpawn(playerid)
    {
    GivePlayerMoney(playerid,20000);
    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,"/lsflug",true)==0)
    {
    SetPlayerPos(playerid,1836.6008,-2382.1763,13.5547);
    ResetPlayerWeapons(playerid);
    GivePlayerWeapon(playerid,24,1000);
    GivePlayerWeapon(playerid,25,1000);
    GivePlayerWeapon(playerid,29,1000);
    SendClientMessage(playerid,0xFF00CDFF, "Du wurdest Teleportiert");
    return 1;

    }
    if(strcmp(cmdtext,"/lvflug",true)==0)
    {
    SetPlayerPos(playerid,1320.2906,1264.9402,10.8203);
    ResetPlayerWeapons(playerid);
    GivePlayerWeapon(playerid,24,1000);
    GivePlayerWeapon(playerid,25,1000);
    GivePlayerWeapon(playerid,29,1000);
    SendClientMessage(playerid,0xFF00CDFF, "Du wurdest Teleportiert");
    return 1;


    }
    if (strcmp("/Shop", cmdtext, true) == 0)
    {
    ShowPlayerDialog(playerid, Shop, DIALOG_STYLE_LIST, "Shop", "MP5 \n M4 \n Eagle \n Combat Shotgun \n Shotgun", "Auswählen", "Abbrechen");
    return 1;

    }
    if(strcmp(cmdtext,"/sfflug",true)==0)
    {
    SetPlayerPos(playerid,-1258.2887,20.2207,14.1484);
    ResetPlayerWeapons(playerid);
    GivePlayerWeapon(playerid,24,1000);
    GivePlayerWeapon(playerid,25,1000);
    GivePlayerWeapon(playerid,29,1000);
    SendClientMessage(playerid,0xFF00CDFF, "Du wurdest Teleportiert");
    return 1;
    }
    if(strcmp(cmdtext,"/Desertflug",true)==0)
    {
    SetPlayerPos(playerid,383.2305,2538.1511,16.5391);
    ResetPlayerWeapons(playerid);
    GivePlayerWeapon(playerid,24,1000);
    GivePlayerWeapon(playerid,25,1000);
    GivePlayerWeapon(playerid,29,1000);
    SendClientMessage(playerid,0xFF00CDFF, "Du wurdest Teleportiert");
    return 1;
    }
    if(strcmp(cmdtext,"/Spawn",true)==0)
    {
    SetPlayerPos(playerid,1097.5486,-1785.4241,13.6376);
    ResetPlayerWeapons(playerid);
    GivePlayerWeapon(playerid,24,1000);
    GivePlayerWeapon(playerid,25,1000);
    GivePlayerWeapon(playerid,29,1000);
    SendClientMessage(playerid,PINK,"Du wurdest Teleportiert");
    return 1;
    }
    if(strcmp(cmdtext,"/chillisland",true)==0)
    {
    SetPlayerPos(playerid,3495.760498, -1941.186768, 10.467955);
    ResetPlayerWeapons(playerid);
    GivePlayerWeapon(playerid,24,1000);
    GivePlayerWeapon(playerid,25,1000);
    GivePlayerWeapon(playerid,29,1000);
    SendClientMessage(playerid,PINK,"Du wurdest Teleportiert");
    return 1;
    }
    if(strcmp(cmdtext,"/kill",true)==0)
    {
    SetPlayerHealth(playerid, 0);
    return 1;
    }
    if(strcmp(cmdtext,"/Adminheal",true)==0)
    {
    SetPlayerHealth(playerid, 100);
    return 1;
    }
    if(strcmp(cmdtext,"/Adminwaffen",true)==0)
    {
    GivePlayerWeapon(playerid,27,1000);
    GivePlayerWeapon(playerid,38,1000);
    return 1;
    }
    if(strcmp(cmdtext,"/Help",true)==0)
    {
    SendClientMessage(playerid,GRÜN,"Willkommen auf unseren Server, hier findest du alle Teleports!");
    SendClientMessage(playerid,GRÜN,"Wenn du anderen Kommandos sehen willst, mache /cmds");
    SendClientMessage(playerid,ROT,"Jetzt zu den Teleports...");
    SendClientMessage(playerid,ROT,"/Spawn,/lsflug,/sfflug,/lvflug,/desertflug,/sfbahnhof,/Area51,/Dmdesertflug,/stunt,/DmWüste");
    return 1;
    }
    if(strcmp(cmdtext,"/Hilfe",true)==0)
    {
    SendClientMessage(playerid,ORANGE,"Bitte benutze /Help!");
    return 1;
    }
    if(strcmp(cmdtext,"/cmds",true)==0)
    {
    SendClientMessage(playerid,GRÜN,"Willkommen auf unseren Server, hier findest du alle Kommandos!");
    SendClientMessage(playerid,GRÜN,"Wenn du die Teleports sehen möchtest, mache /Help");
    SendClientMessage(playerid,ROT,"Jetzt du den Kommandos...");
    SendClientMessage(playerid,ROT,"/kill");
    SendClientMessage(playerid,ROT,"Weitere kommen die Nächsten Tage noch!");
    return 1;
    }
    if(strcmp(cmdtext,"/Ammu",true)==0)
    {
    SetPlayerPos(playerid,1363.1777,-1273.8859,13.5469);
    ResetPlayerWeapons(playerid);
    GivePlayerWeapon(playerid,24,1000);
    GivePlayerWeapon(playerid,25,1000);
    GivePlayerWeapon(playerid,29,1000);
    SendClientMessage(playerid,PINK,"Du wurdest Teleportiert");
    return 1;
    }
    if(strcmp(cmdtext,"/sfbahnhof",true)==0)
    {
    SetPlayerPos(playerid,-1981.4668,137.9324,30.4085);
    ResetPlayerWeapons(playerid);
    GivePlayerWeapon(playerid,24,1000);
    GivePlayerWeapon(playerid,25,1000);
    GivePlayerWeapon(playerid,29,1000);
    SendClientMessage(playerid,PINK,"Du wurdest Teleportiert");
    return 1;
    }
    if(strcmp(cmdtext,"/area51",true)==0)
    {
    SetPlayerPos(playerid,202.8332,1868.6818,13.1406);
    ResetPlayerWeapons(playerid);
    GivePlayerWeapon(playerid,38,50000);
    SendClientMessage(playerid,PINK,"Du wurdest Teleportiert und dir wurden Waffen gegeben");
    return 1;
    }
    if(strcmp(cmdtext,"/dmdesertflug",true)==0)
    {
    SetPlayerPos(playerid,153.9938,2409.1060,17.6744);
    ResetPlayerWeapons(playerid);
    GivePlayerWeapon(playerid,38,50000);
    SendClientMessage(playerid,PINK,"Du wurdest Teleportiert");
    return 1;
    }
    if(strcmp(cmdtext,"/stunt",true)==0)
    {
    SetPlayerPos(playerid,-670.7929,2308.8347,135.1452);
    ResetPlayerWeapons(playerid);
    GivePlayerWeapon(playerid,24,1000);
    GivePlayerWeapon(playerid,25,1000);
    GivePlayerWeapon(playerid,29,1000);
    SendClientMessage(playerid,PINK,"Du wurdest Teleportiert");
    return 1;
    }
    if(strcmp(cmdtext,"/dmWüste",true)==0)
    {
    SetPlayerPos(playerid,-376.6884,2225.4387,42.4094);
    ResetPlayerWeapons(playerid);
    GivePlayerWeapon(playerid,38,50000);
    SendClientMessage(playerid,PINK,"Du wurdest Teleportiert und dir wurden Waffen gegeben");
    return 1;
    }
    if (!strcmp("/fix", cmdtext))
    {
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,ORANGE, "Du bist in keinem Auto!");
    RepairVehicle(GetPlayerVehicleID(playerid));
    SendClientMessage(playerid, ORANGE, "Dein Auto wurde repariert!");
    return 1;
    }
    if(strcmp("/Rüstung",cmdtext,true)==0)
    {
    SetPlayerArmour(playerid,100);
    SendClientMessage(playerid,ORANGE,"Du hast eine Rüstung bekommen");
    return 1;
    }
    dcmd(givemoney,9,cmdtext);
    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[])
    {
    new pname[MAX_PLAYERS],accFormat[128];
    GetPlayerName(playerid,pname,sizeof pname);
    format(accFormat,sizeof accFormat,"%s.datei",pname);
    if(response)
    {
    switch(dialogid) // dialogid auswählen
    {
    case DIALOG_LOGIN: // ID Login
    {
    if(!strlen(inputtext))
    {
    ShowPlayerDialog(playerid,DIALOG_LOGIN,1,"Login","Bitte logge dich ein","Weiter","Abbrechen");
    return SendClientMessage(playerid,0xFFFFFFFF,"Kein Passwort angegeben!");
    }
    if(strcmp(inputtext,dini_Get(accFormat,"Passwort")) == 0) // Passwort Direkt aus der Datei Laden
    {
    Spieler[playerid][money] = dini_Int(accFormat,"money");
    Spieler[playerid][score] = dini_Int(accFormat,"score");
    Spieler[playerid][wanted] = dini_Int(accFormat,"wanted");
    Spieler[playerid][skin] = dini_Int(accFormat,"skin");
    Spieler[playerid][lastx] = dini_Float(accFormat,"lastx");
    Spieler[playerid][lasty] = dini_Float(accFormat,"lasty");
    Spieler[playerid][lastz] = dini_Float(accFormat,"lastz");
    Spieler[playerid][eingeloggt] = 1; // Spieler ist nun erfolgreich eingeloggt
    SendClientMessage(playerid,0xFFFFFFFF,"Du wurdest erfolgreich eingeloggt.");
    }
    else
    {
    ShowPlayerDialog(playerid,DIALOG_LOGIN,1,"Login","Bitte logge dich ein","Weiter","Abbrechen");
    SendClientMessage(playerid,0xFFFFFFFF,"Das Passwort war Falsch!");
    }
    }
    case DIALOG_REG: // ID Registrieren
    {
    if(!strlen(inputtext)) // Text darf nicht = Null sein Null im Sinne von nichts
    {
    ShowPlayerDialog(playerid,DIALOG_REG,1,"Registrieren","Bitte Registriere dich","Weiter","Abbrechen");
    return SendClientMessage(playerid,0xFFFFFFFF,"Das Passwort ist zu kurz!");
    }
    dini_Create(accFormat);
    dini_Set(accFormat,"Passwort",inputtext);
    Spieler[playerid][eingeloggt] = 1;
    SendClientMessage(playerid,0xFFFFFFFF,"Account wurde angelegt und du wurdest eingeloggt.");
    }
    }
    }
    else
    {
    switch(dialogid)
    {
    case DIALOG_LOGIN:ShowPlayerDialog(playerid,DIALOG_LOGIN,1,"Login","Bitte logge dich ein","Weiter","Abbrechen");
    case DIALOG_REG:ShowPlayerDialog(playerid,DIALOG_REG,1,"Registrieren","Bitte Registriere dich","Weiter","Abbrechen");
    }
    }
    return 1;

    //shop

    if(dialogid == Shop)
    {
    if(response)
    {
    if(listitem == 0) // Mp5
    {
    if(GetPlayerMoney(playerid) >= 500)
    {
    GivePlayerWeapon(playerid, 29, 250);
    GivePlayerMoney(playerid, -500);
    }
    }
    {
    if(listitem == 1) // M4
    if(GetPlayerMoney(playerid) >= 1000)
    {
    GivePlayerWeapon(playerid, 31 , 250);
    GivePlayerMoney(playerid, -1000);
    }
    }
    {
    if(listitem == 2) // Eagle
    if(GetPlayerMoney(playerid) >= 250)
    {
    GivePlayerWeapon(playerid, 24 , 150);
    GivePlayerMoney(playerid, -250);
    }
    }
    {
    if(listitem == 3) // Combat Shotgun
    if(GetPlayerMoney(playerid) >= 1500)
    {
    GivePlayerWeapon(playerid, 27 , 150);
    GivePlayerMoney(playerid, -1500);
    }
    }
    }



    public OnPlayerClickPlayer(playerid, clickedplayerid, source)
    {
    return 1;
    }



    dcmd_givemoney(playerid,params[])
    {
    new
    betrag, // hier erstellen wir die parameter. in deinem fall den betrag des geldes das gegeben wird und pID ist der spieler der das ganze erhalten soll
    pID;


    if(sscanf(params, "di",pID,betrag))
    {
    return SendClientMessage(playerid,BLAU,"Nutze: /givemoney [ID] [betrag]"); // hier wird abgefragt ob beide parameter angegeben werden. wenn nein returnt das ganze mit der nachricht
    }
    if(!IsPlayerConnected(pID))
    {
    return SendClientMessage(playerid,BLAU,"Kein Spieler mit angegebener ID Online"); // hier wird abgefragt ob der Spieler mit der angegebenen Id online ist
    }


    if(GetPlayerMoney(playerid)>=betrag) // dast ist zwar nicht unbedingt notwendig, sollte aber drin sein. da wird überprüft ob der spieler genügend geld hat. deswegen wird abgefragt ob das geld das er gerade hat (getplayermoney) größer oder gleich (>=) wie der angegebene betrag ist.
    {
    new name[MAX_PLAYER_NAME],nachricht[64];
    GetPlayerName(playerid,name,sizeof(name)); // das ist einfach für die Nachricht damit der Spieler der das geld bekommt informiert wird wie viel und von wem er geld bekommen hat.
    format(nachricht,sizeof(nachricht),"%s gab dir %i €",name,betrag);



    SendClientMessage(pID,BLAU,nachricht); //das ist der wesentliche teil: die geldübergabe. hier wird die nachricht gesendet
    GivePlayerMoney(pID,betrag); // hier wird pID, also dem spieler der angegeben wurde das geld in höhe von betrag gegeben
    GivePlayerMoney(playerid,-betrag); // und hier wird dem spieler der das commando ausführt der betrag abgezogen (-betrag)
    }


    return 1;
    }


  • /*----------------------------------------------------------------------------*-
    Function:
    sscanf
    Params:
    string[] - String to extract parameters from.
    format[] - Parameter types to get.
    {Float,_}:... - Data return variables.
    Return:
    0 - Successful, not 0 - fail.
    Notes:
    A fail is either insufficient variables to store the data or insufficient
    data for the format string - excess data is disgarded.
    A string in the middle of the input data is extracted as a single word, a
    string at the end of the data collects all remaining text.
    The format codes are:
    c - A character.
    d, i - An integer.
    h, x - A hex number (e.g. a colour).
    f - A float.
    s - A string.
    z - An optional string.
    pX - An additional delimiter where X is another character.
    '' - Encloses a litteral string to locate.
    u - User, takes a name, part of a name or an id and returns the id if they're connected.
    Now has IsNumeric integrated into the code.
    Added additional delimiters in the form of all whitespace and an
    optioanlly specified one in the format string.
    -*----------------------------------------------------------------------------*/
    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;
    }
    stock strget(strx[], pos, search = ' ') {
    new arg, ret[128], idxx;
    for (new i = 0; i < strlen(strx); i++) {
    if(strx[i] == search || i == strlen(strx) || strx[i + 1] == 10) {
    arg++;
    if (arg == pos + 1){
    ret[i-idxx] = EOS;
    return ret;
    } else if (arg == pos)
    idxx= i+1;
    }
    else if (arg == pos)
    ret[i - idxx] = strx[i];
    }
    return ret;
    }