Beiträge von barcelona

    Meist so:


    public OnPlayerCommandText(playerid, cmdtext[])
    {
    if(strcmp(cmdtext, "/Aarea", true) == 0)
    {
    if(admlevel[playerid]>0)
    {
    SetPlayerPos(playerid, -377.6190,1739.6788,42.5601); //x,y und z sind die coords wo er hingeportet werden soll
    }
    else
    {
    SendClientMessage(playerid, 0xFFFF00AA,"Du bist kein Admin!");
    }
    return 1;

    public money(playerid)
    {
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(GetPlayerMoney(i) > geld[i]&&geld[i]-GetPlayerMoney(i)>1000)
    {
    new pname[MAX_PLAYER_NAME];
    new string[100];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(string, sizeof(string), "[SA-Anti-Cheat®] %s wurde wegen MoneyHack gebannt!", pname);
    SendClientMessageToAll(COLOR_RED, string);
    geld[i]=GetPlayerMoney(i);
    Kick(i);
    }
    geld[i]=GetPlayerMoney(i);
    }
    }
    So ungefähr wird ichs machen :rolleyes:
    EDIT: Sonst [INCLUDE] Anti Moneyhack

    if(strcmp(cmd, "/cuff", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    if((PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pFraktion] == 1)&&(!IsPlayerInAnyVehicle(playa))&&(PlayerInfo[playerid][pRank]>=3))
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GREY, "Benutze: /cuff [playerid]");
    return 1;
    }
    new playa;


    playa = strval(tmp);


    GetPlayerName(playa, giveplayer, sizeof(giveplayer));
    GetPlayerName(playerid, sendername, sizeof(sendername));

    TogglePlayerControllable(playa, 0);
    GameTextForPlayer(playa, "Festgenommen", 3000, 4);

    format(string, sizeof(string), "Du hast %s festgenommen.", giveplayer);
    SendClientMessage(playerid, COLOR_YELLOW, string);
    return 1;
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY,"Du bist nicht befugt diesen Befehl zu nutzen!");
    }
    return 1;
    }
    }
    weiss nur nich ob der rang bei dir so definiert is, ausserdem is die fehlermeldung manchma nicht ganz passend =)

    Ich wollte ein bizsystem scripten, indem ich enum playerInfo kopiere und so abändere, das daraus enum BizInfo wird...
    jetzt habe ich errors:

    D:\sampserver\gamemodes\monsteer.pwn(330) : error 017: undefined symbol "ini_GetKey"
    D:\sampserver\gamemodes\monsteer.pwn(330) : error 033: array must be indexed (variable "key")
    D:\sampserver\gamemodes\monsteer.pwn(331) : error 017: undefined symbol "ini_GetValue"
    D:\sampserver\gamemodes\monsteer.pwn(331) : error 033: array must be indexed (variable "val")
    D:\sampserver\gamemodes\monsteer.pwn(332) : error 017: undefined symbol "ini_GetValue"
    D:\sampserver\gamemodes\monsteer.pwn(332) : error 033: array must be indexed (variable "val")
    D:\sampserver\gamemodes\monsteer.pwn(333) : error 017: undefined symbol "ini_GetValue"
    D:\sampserver\gamemodes\monsteer.pwn(333) : error 033: array must be indexed (variable "val")
    D:\sampserver\gamemodes\monsteer.pwn(334) : error 017: undefined symbol "ini_GetValue"
    D:\sampserver\gamemodes\monsteer.pwn(334) : error 033: array must be indexed (variable "val")
    D:\sampserver\gamemodes\monsteer.pwn(335) : error 017: undefined symbol "ini_GetValue"
    D:\sampserver\gamemodes\monsteer.pwn(335) : error 033: array must be indexed (variable "val")
    D:\sampserver\gamemodes\monsteer.pwn(336) : error 017: undefined symbol "ini_GetValue"
    D:\sampserver\gamemodes\monsteer.pwn(336) : error 033: array must be indexed (variable "val")
    D:\sampserver\gamemodes\monsteer.pwn(337) : error 017: undefined symbol "ini_GetValue"
    D:\sampserver\gamemodes\monsteer.pwn(337) : error 033: array must be indexed (variable "val")
    D:\sampserver\gamemodes\monsteer.pwn(338) : error 017: undefined symbol "ini_GetValue"
    D:\sampserver\gamemodes\monsteer.pwn(338) : error 033: array must be indexed (variable "val")
    D:\sampserver\gamemodes\monsteer.pwn(339) : error 017: undefined symbol "ini_GetValue"
    D:\sampserver\gamemodes\monsteer.pwn(339) : error 033: array must be indexed (variable "val")
    D:\sampserver\gamemodes\monsteer.pwn(340) : error 017: undefined symbol "ini_GetValue"
    D:\sampserver\gamemodes\monsteer.pwn(340) : error 033: array must be indexed (variable "val")
    D:\sampserver\gamemodes\monsteer.pwn(341) : error 017: undefined symbol "ini_GetValue"
    D:\sampserver\gamemodes\monsteer.pwn(341) : error 033: array must be indexed (variable "val")
    D:\sampserver\gamemodes\monsteer.pwn(342) : error 017: undefined symbol "ini_GetValue"
    D:\sampserver\gamemodes\monsteer.pwn(342) : error 033: array must be indexed (variable "val")


    //BIZZZZZZZZZZZZZZZZZZZZZZZZZZ
    for(new i = 0; i < MAX_BIZ; i++)
    {
    new string2 [80];
    format(string2, sizeof(string2), "%d.biz", i);
    new File: UserFile = fopen(string2, io_read);
    if (UserFile)
    {
    new key[128],val[128];
    new Data[128];
    while(fread(UserFile,Data,sizeof(Data)))
    {
    key = ini_GetKey(Data);//ZEILE 330
    if( strcmp( key , "Kasse" , true ) == 0 ) { val = ini_GetValue( Data ); BizInfo[i][bKasse] = strval( val ); }
    if( strcmp( key , "Name" , true ) == 0 ) { val = ini_GetValue( Data ); BizInfo[i][bName] = strval( val ); }
    if( strcmp( key , "Owner" , true ) == 0 ) { val = ini_GetValue( Data ); BizInfo[i][bOwner] = strval( val ); }
    if( strcmp( key , "PosX" , true ) == 0 ) { val = ini_GetValue( Data ); BizInfo[i][bPosX] = floatstr( val ); }
    if( strcmp( key , "PosY" , true ) == 0 ) { val = ini_GetValue( Data ); BizInfo[i][bPosY] = floatstr( val ); }
    if( strcmp( key , "PosZ" , true ) == 0 ) { val = ini_GetValue( Data ); BizInfo[i][bPosZ] = floatstr( val ); }
    if( strcmp( key , "PosiX" , true ) == 0 ) { val = ini_GetValue( Data ); BizInfo[i][bPosiX] = floatstr( val ); }
    if( strcmp( key , "PosiY" , true ) == 0 ) { val = ini_GetValue( Data ); BizInfo[i][bPosiY] = floatstr( val ); }
    if( strcmp( key , "PosiZ" , true ) == 0 ) { val = ini_GetValue( Data ); BizInfo[i][bPosiZ] = floatstr( val ); }
    if( strcmp( key , "PosInt" , true ) == 0 ) { val = ini_GetValue( Data ); BizInfo[i][bPosInt] = strval( val ); }
    if( strcmp( key , "PosVw" , true ) == 0 ) { val = ini_GetValue( Data ); BizInfo[i][bPosVw] = strval( val ); }
    if( strcmp( key , "EnterPrize" , true ) == 0 ) { val = ini_GetValue( Data ); BizInfo[i][bEnterPrize] = strval( val ); }//ZEILE 342
    if( strcmp( key , "Grundpreis" , true ) == 0 ) { val = ini_GetValue( Data ); BizInfo[i][bGrundpreis] = strval( val ); }
    if( strcmp( key , "Enterable" , true ) == 0 ) { val = ini_GetValue( Data ); BizInfo[i][bEnterable] = strval( val ); }
    if( strcmp( key , "Opened" , true ) == 0 ) { val = ini_GetValue( Data ); BizInfo[i][bOpened] = strval( val ); }
    if( strcmp( key , "Prods" , true ) == 0 ) { val = ini_GetValue( Data ); BizInfo[i][bProds] = strval( val ); }
    fclose(UserFile);}
    //BIZZZZZZZZZZZZZZZZZZZZZZZZZZ

    was muss ich tun? X(

    Folgende warnings:
    D:\sampserver\gamemodes\monsteer.pwn(3183) : warning 213: tag mismatch
    D:\sampserver\gamemodes\monsteer.pwn(3184) : warning 213: tag mismatch
    D:\sampserver\gamemodes\monsteer.pwn(3185) : warning 213: tag mismatch
    Die Zeilen:
    //OnPlayerLogin
    if( strcmp( key , "Sx" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pSx] = strval( val ); }
    if( strcmp( key , "Sy" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pSy] = strval( val ); }
    if( strcmp( key , "Sz" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pSz] = strval( val ); }
    Liegt wohl daran, dass das floats sind, wie kann ich es so machen, dass es funktioniert?

    So, es gibt eine neue Version. Folgendes wurde verbessert:


    - Weniger Falschkicks: Wenn das neue Geld unter dem alten liegt (ins minus "gecheatet"), wird man nicht gekickt
    - Neue Funktion xSetMinMoney, mehr dazu im ersten Post
    - Neue Funktion xSetAntiStuntBonus, mehr dazu im ersten Post