Beiträge von [LoG]xSprite

    Spoiler anzeigen

    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':
    {

    Spoiler anzeigen
    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;
    }

    SendClientMessageToAll(Farbe,"Text");
    oder du machst dierekt einen string :o



    new string[128];
    format(string,sizeof(string),"INFO: Administrator %s Startet den Server neu! ",PlayerName(playerid));
    SendClientMessageToAll(Farbe,string);////


    Spoiler anzeigen


    C:\Users\DefiNe\Desktop\Selfmade\gamemodes\fdr.pwn(104) : error 035: argument type mismatch (argument 2)

    Spoiler anzeigen
    SendClientMessageToAll(playerid,GELB,"Der Server ist neuamstarten. Wir sind sofort wieder da!");
    // das playerid, muss weg.
    SendClientMessageToAll(GELB,"Der Server ist neuamstarten. Wir sind sofort wieder da!");


    SetPlayerMoney(playerid,cache_get_field_content_int(0,"money",dbhandle));
    sInfo[playerid][skin] = cache_get_field_content_int(0,"skin",dbhandle);

    unter onplayerspawn

    SetPlayerSkin(playerid,sInfo[playerid][skin]);



    if(sInfo[playerid][eingeloggt]==0)return 1;//Speichert keine leute die nicht eingeloggt sind
    new query[256],query2[256];
    format(query,sizeof(query),"UPDATE user SET level='%i',geld='%i', skin='%i' , alevel='%i', fraktion='%i', rang='%i', schange='%i', WLevel='%i', knast='%i', ngknast='%i' , hstatus='i' WHERE id='%i'",sInfo[playerid][level],GetPlayerMoney(playerid),sInfo[playerid][skin],sInfo[playerid][alevel],sInfo[playerid][fraktion],sInfo[playerid][rang],sInfo[playerid][schange],GetPlayerWantedLevel(playerid),sInfo[playerid][knast],sInfo[playerid][ngknast],sInfo[playerid][hstatus],sInfo[playerid][id]);
    format(query,sizeof(query),"UPDATE user SET sjob='%i' WHERE id='%i'",sInfo[playerid][sjob],sInfo[playerid][id]);
    mysql_function_query(dbhandle,query,false,"","");
    mysql_function_query(dbhandle,query2,false,"","");


    das SetPlayerMoney:

    SetPlayerMoney(playerid,money)
    {
    ResetPlayerMoney(playerid);
    GivePlayerMoney(playerid,money);
    return 1;
    }

    damit der Spieler nicht durch irgendeinen Bug mehr Geld bekommt als er hat.

    Naja die Errors sagen dir ja, das M_OnPlayerCommandText nicht definiert wurde und NameTimer auch nicht.
    und "M_OnPlayerStateChange" wurde nie benutzt..


    wir müssten mehr sehen als nur die Zeilen

    Hey LEute
    Ich habe das Problem das der Skin einfach nicht gespeichert und geladen wird..




    // wenn der Spieler geladen wird


    sInfo[playerid][skin] = cache_get_field_content_int(0,"skin",dbhandle);
    SetPlayerSkin(playerid,sInfo[playerid][skin]);



    //Spieler Speichern :D
    savePlayer(playerid)
    {
    if(sInfo[playerid][eingeloggt]== 0) return 1;
    //Speichern level,money,alevel,fraktion,skin
    new query[256];


    format(query,sizeof(query),"UPDATE user SET
    level='%i',money='%i',alevel='%i',fraktion='%i',rang='%i',skin='%i',ssTickets='%i'
    WHERE
    id='%i'",sInfo[playerid][level],GetPlayerMoney(playerid),sInfo[playerid][alevel],sInfo[playerid][fraktion],sInfo[playerid][rang],sInfo[playerid][skin],sInfo[playerid][ssTickets],sInfo[playerid][db_id]);
    mysql_function_query(dbhandle,query,false,"","");
    return 1;
    }


    Ich hoffe einer von euch kann mir helfen

    du hast das return vergessen



    ocmd:aduty(playerid, params[])
    {
    if(Aduty[playerid] == false)
    {
    Aduty[playerid] = true;
    SendClientMessage(playerid,ROT,"-|Du bist nun im Admin-Dienst|-");
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    strins(pName,"[VRP]",0);
    SetPlayerName(playerid,pName);
    }
    else
    {
    Aduty[playerid] = false;
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    strdel(pName,0,5);
    SetPlayerName(playerid,pName);
    }
    return 1;
    }

    bsnenter = CreatePickup(1559,1199.2650,-918.1416,43.1232, -1);


    machs am besten so im Script..


    ganz oben


    new bsnenter, bsnexit;


    OnGameModeInit

    bsnenter= CreatePickup(1239, 2,1199.3990,-920.6162,43.1092, -1);
    bsnexit = CreatePickup(1239, 2,362.8329,-75.1307,1001.5078, -1);


    public OnPlayerPickUpPickup(playerid, pickupid)



    if(pickupid == bsnenter)
    {
    SetPlayerPos(playerid,363.6038,-74.6662,1001.5078);
    SetPlayerFacingAngle(playerid,311.2533);
    SetPlayerInterior(playerid,10);
    }
    if(pickupid == bsnexit)
    {
    SetPlayerPos(playerid,1199.3311,-921.7978,43.0268);
    SetPlayerInterior(playerid,0);
    }

    Hey Leute..
    habe ein Testserver erstellt um nen bischen zu Scripten klappt auch eigentlich alles ganz gut
    nur habe ich jetzt das Problem das beim /stats nicht gezeigt wird ob ich den Führerschein hab oder nicht..



    if (strcmp("/stats", cmdtext, true, 10) == 0)
    {
    new string[128];
    new ftext[64];
    new dtext[64];
    new level = sSpieler[playerid][Fraktion];
    if(level == 0) { ftext= "{D2A400}Zivi"; }
    else if(level ==1) { ftext= "{D2A400}LSPD"; }
    else if(level ==2) { ftext= "{D2A400}FBI"; }
    else if(level ==3) { ftext= "{D2A400}Army"; }
    else if(level ==4) { ftext= "{D2A400}Medic"; }
    else if(level ==5) { ftext= "{D2A400}Terror"; }
    else if(level ==6) { ftext= "{D2A400}Grove"; }
    else if(level ==7) { ftext= "{D2A400}Ballas"; }
    else if(level ==8) { ftext= "{D2A400}Special Air Force"; }
    new Autoschein = sSpieler[playerid][Autoschein];
    if(Autoschein == 0) { dtext= "{FF0005}Nein"; }
    else if(Autoschein ==1) { dtext= "{00FF0A}Ja"; }
    format(string,sizeof(string),"{00FFFF}Dein Adminlevel: %d\n{00FFFF}Dein Geld: %d\n{00FFFF}Deine Fraktion: %s\n{00FFFF}Autoschein: %s ",sSpieler[playerid],GetPlayerMoney(playerid),ftext,dtext);
    ShowPlayerDialog(playerid,STATS,DIALOG_STYLE_MSGBOX,"{FF0005}Deine Stats",string,"Ok","Ok");
    return 1;
    }