Beiträge von HunterBoY998

    Hey,
    ich will von SetPVarInt alles mit PVar ... zu enums machen nun bin ich net der beschte im Scripten und suche jemanden der mir das über TV (TeamViewer) macht.


    Codes:


    Codes von den stocks:


    stock Register(playerid,key[])
    {
    new Spielerdatei[128];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(Spielerdatei,sizeof(Spielerdatei),"/Accounts/%s.txt",name);
    dini_Create(Spielerdatei);
    dini_Set(Spielerdatei,"Passwort",key);
    SetPlayerScore(playerid,1);
    SetPVarInt(playerid,"loggedin",1);
    PlayerInfo[playerid][pAdminlevel] = 0;
    PlayerInfo[playerid][pFraktion] = 0;
    PlayerInfo[playerid][pGeschlecht] = 0;
    PlayerInfo[playerid][pGeld] = 5000;
    PlayerInfo[playerid][pPerso] = 0;
    PlayerInfo[playerid][pJob] = 0;
    PlayerInfo[playerid][pFahrrad] = 0;
    PlayerInfo[playerid][pFahrradstatus] = 0;
    PlayerInfo[playerid][pOnDuty] = 0;
    GivePlayerMoney(playerid,5000);
    return 1;
    }


    stock Login(playerid,key[])
    {
    new Spielerdatei[64];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(Spielerdatei,sizeof(Spielerdatei),"/Accounts/%s.txt",name);
    if(gettime()<PlayerInfo[playerid][ptimeban])
    {
    SendClientMessage(playerid,rot,"Du bist noch gebannt. Komm später wieder.");
    Kick(playerid);
    return 1;
    }
    if(!strcmp(key,dini_Get(Spielerdatei,"Passwort"),false))
    {
    LoadAccount(playerid);
    return 1;
    }
    else
    {
    SendClientMessage(playerid,rot,"Das Passwort stimmt nicht.");
    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","{FFFFFF}Dein Account wurde in der Datenbank gefunden.\n\nBitte gebe nun dein{FF6E00} Passwort{FFFFFF} ein.\nGib dein {FF6E00}Passwort {FFFFFF}niemals an andere {FF6E00}User {FFFFFF}oder{FF6E00} Supporter{FFFFFF} weiter.\n","Login",""); return 1;
    }
    }



    stock LoadAccount(playerid)
    {
    new Spielerdatei[64];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(Spielerdatei,sizeof(Spielerdatei),"/Accounts/%s.txt",name);
    SetPlayerScore(playerid,dini_Int(Spielerdatei,"Level"));
    SetPlayerWantedLevel(playerid,dini_Int(Spielerdatei,"Wanted"));
    GivePlayerMoney(playerid,dini_Int(Spielerdatei,"Geld"));
    PlayerInfo[playerid][pAdminlevel];
    PlayerInfo[playerid][pFraktion];
    PlayerInfo[playerid][pBaned];
    PlayerInfo[playerid][pJob];
    PlayerInfo[playerid][pKills];
    PlayerInfo[playerid][pTode];
    PlayerInfo[playerid][pFahrrad];
    PlayerInfo[playerid][pFahrradstatus];
    PlayerInfo[playerid][pWanted];
    PlayerInfo[playerid][pGeschlecht];
    PlayerInfo[playerid][pPerso];
    PlayerInfo[playerid][pOnDuty];
    if(PlayerInfo[playerid][pBaned]==1)
    {
    SendClientMessage(playerid,rot,"Du bist vom Server gebannt.");
    Kick(playerid);
    }
    SetPVarInt(playerid,"loggedin",1);
    return 1;
    }


    stock SavePlayer(playerid)
    {
    if(GetPVarInt(playerid,"loggedin")==1)
    {
    new Spielerdatei[64];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(Spielerdatei,sizeof(Spielerdatei),"/Accounts/%s.txt",name);
    dini_IntSet(Spielerdatei,"Level",GetPlayerScore(playerid));
    dini_IntSet(Spielerdatei,"Geld",GetPlayerMoney(playerid));
    dini_IntSet(Spielerdatei,"Adminlevel",PlayerInfo[playerid][pAdminlevel]);
    dini_IntSet(Spielerdatei,"Fraktion",PlayerInfo[playerid][pFraktion]);
    dini_IntSet(Spielerdatei,"Baned",PlayerInfo[playerid][pBaned]);
    dini_IntSet(Spielerdatei,"timeban",PlayerInfo[playerid][ptimeban]);
    dini_IntSet(Spielerdatei,"Wanted",PlayerInfo[playerid][pWanted]);
    dini_IntSet(Spielerdatei,"Geschlecht",PlayerInfo[playerid][pGeschlecht]);
    dini_IntSet(Spielerdatei,"Perso",PlayerInfo[playerid][pPerso]);
    dini_IntSet(Spielerdatei,"Job",PlayerInfo[playerid][pJob]);
    dini_IntSet(Spielerdatei,"Kills",PlayerInfo[playerid][pKills]);
    dini_IntSet(Spielerdatei,"Tode",PlayerInfo[playerid][pTode]);
    dini_IntSet(Spielerdatei,"Fahrrad",PlayerInfo[playerid][pFahrrad]);
    dini_IntSet(Spielerdatei,"Fahrradstatus",PlayerInfo[playerid][pFahrradstatus]);
    dini_IntSet(Spielerdatei,"OnDuty",PlayerInfo[playerid][pOnDuty]);
    }
    return 1;
    }



    Code von Enum:


    enum spieler_daten
    {
    pLevel,
    pGeld,
    pAdminlevel,
    pFraktion,
    pBaned,
    ptimeban,
    pWanted,
    pGeschlecht,
    pPerso,
    pJob,
    pKills, pTode,
    pFahrrad,
    pFahrradstatus,
    pOnDuty
    }


    new PlayerInfo[MAX_PLAYERS][spieler_daten];


    MFG

    Irgendwie lädt er net die Accounts.
    Codes von den stocks:


    stock Register(playerid,key[])
    {
    new Spielerdatei[128];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(Spielerdatei,sizeof(Spielerdatei),"/Accounts/%s.txt",name);
    dini_Create(Spielerdatei);
    dini_Set(Spielerdatei,"Passwort",key);
    SetPlayerScore(playerid,1);
    SetPVarInt(playerid,"loggedin",1);
    PlayerInfo[playerid][pAdminlevel] = 0;
    PlayerInfo[playerid][pFraktion] = 0;
    PlayerInfo[playerid][pGeschlecht] = 0;
    PlayerInfo[playerid][pGeld] = 5000;
    PlayerInfo[playerid][pPerso] = 0;
    PlayerInfo[playerid][pJob] = 0;
    PlayerInfo[playerid][pFahrrad] = 0;
    PlayerInfo[playerid][pFahrradstatus] = 0;
    PlayerInfo[playerid][pOnDuty] = 0;
    GivePlayerMoney(playerid,5000);
    return 1;
    }


    stock Login(playerid,key[])
    {
    new Spielerdatei[64];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(Spielerdatei,sizeof(Spielerdatei),"/Accounts/%s.txt",name);
    if(gettime()<PlayerInfo[playerid][ptimeban])
    {
    SendClientMessage(playerid,rot,"Du bist noch gebannt. Komm später wieder.");
    Kick(playerid);
    return 1;
    }
    if(!strcmp(key,dini_Get(Spielerdatei,"Passwort"),false))
    {
    LoadAccount(playerid);
    return 1;
    }
    else
    {
    SendClientMessage(playerid,rot,"Das Passwort stimmt nicht.");
    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","{FFFFFF}Dein Account wurde in der Datenbank gefunden.\n\nBitte gebe nun dein{FF6E00} Passwort{FFFFFF} ein.\nGib dein {FF6E00}Passwort {FFFFFF}niemals an andere {FF6E00}User {FFFFFF}oder{FF6E00} Supporter{FFFFFF} weiter.\n","Login",""); return 1;
    }
    }



    stock LoadAccount(playerid)
    {
    new Spielerdatei[64];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(Spielerdatei,sizeof(Spielerdatei),"/Accounts/%s.txt",name);
    SetPlayerScore(playerid,dini_Int(Spielerdatei,"Level"));
    SetPlayerWantedLevel(playerid,dini_Int(Spielerdatei,"Wanted"));
    GivePlayerMoney(playerid,dini_Int(Spielerdatei,"Geld"));
    PlayerInfo[playerid][pAdminlevel];
    PlayerInfo[playerid][pFraktion];
    PlayerInfo[playerid][pBaned];
    PlayerInfo[playerid][pJob];
    PlayerInfo[playerid][pKills];
    PlayerInfo[playerid][pTode];
    PlayerInfo[playerid][pFahrrad];
    PlayerInfo[playerid][pFahrradstatus];
    PlayerInfo[playerid][pWanted];
    PlayerInfo[playerid][pGeschlecht];
    PlayerInfo[playerid][pPerso];
    PlayerInfo[playerid][pOnDuty];
    if(PlayerInfo[playerid][pBaned]==1)
    {
    SendClientMessage(playerid,rot,"Du bist vom Server gebannt.");
    Kick(playerid);
    }
    SetPVarInt(playerid,"loggedin",1);
    return 1;
    }


    stock SavePlayer(playerid)
    {
    if(GetPVarInt(playerid,"loggedin")==1)
    {
    new Spielerdatei[64];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(Spielerdatei,sizeof(Spielerdatei),"/Accounts/%s.txt",name);
    dini_IntSet(Spielerdatei,"Level",GetPlayerScore(playerid));
    dini_IntSet(Spielerdatei,"Geld",GetPlayerMoney(playerid));
    dini_IntSet(Spielerdatei,"Adminlevel",PlayerInfo[playerid][pAdminlevel]);
    dini_IntSet(Spielerdatei,"Fraktion",PlayerInfo[playerid][pFraktion]);
    dini_IntSet(Spielerdatei,"Baned",PlayerInfo[playerid][pBaned]);
    dini_IntSet(Spielerdatei,"timeban",PlayerInfo[playerid][ptimeban]);
    dini_IntSet(Spielerdatei,"Wanted",PlayerInfo[playerid][pWanted]);
    dini_IntSet(Spielerdatei,"Geschlecht",PlayerInfo[playerid][pGeschlecht]);
    dini_IntSet(Spielerdatei,"Perso",PlayerInfo[playerid][pPerso]);
    dini_IntSet(Spielerdatei,"Job",PlayerInfo[playerid][pJob]);
    dini_IntSet(Spielerdatei,"Kills",PlayerInfo[playerid][pKills]);
    dini_IntSet(Spielerdatei,"Tode",PlayerInfo[playerid][pTode]);
    dini_IntSet(Spielerdatei,"Fahrrad",PlayerInfo[playerid][pFahrrad]);
    dini_IntSet(Spielerdatei,"Fahrradstatus",PlayerInfo[playerid][pFahrradstatus]);
    dini_IntSet(Spielerdatei,"OnDuty",PlayerInfo[playerid][pOnDuty]);
    }
    return 1;
    }



    Code von Enum:


    enum spieler_daten
    {
    pLevel,
    pGeld,
    pAdminlevel,
    pFraktion,
    pBaned,
    ptimeban,
    pWanted,
    pGeschlecht,
    pPerso,
    pJob,
    pKills, pTode,
    pFahrrad,
    pFahrradstatus,
    pOnDuty
    }


    new PlayerInfo[MAX_PLAYERS][spieler_daten];



    MFG

    new PoliceCar[33];


    PoliceCar[0] = AddStaticVehicle(427,1528.9585,-1688.1089,6.0220,270.1985,0,1); // lspdcar 1
    PoliceCar[1] = AddStaticVehicle(427,1528.9513,-1683.9355,6.0226,269.5105,0,1); // lspdcar 2
    PoliceCar[2] = AddStaticVehicle(528,1538.7559,-1645.2733,5.9347,180.5644,0,0); // lspdcar 3
    PoliceCar[3] = AddStaticVehicle(528,1534.6256,-1645.2428,5.9345,179.7258,0,0); // lspdcar 4
    PoliceCar[4] = AddStaticVehicle(528,1530.4272,-1645.2274,5.9343,180.0705,0,0); // lspdcar 5
    PoliceCar[5] = AddStaticVehicle(528,1526.5116,-1645.2708,5.9344,180.4315,0,0); // lspdcar 6
    PoliceCar[6] = AddStaticVehicle(596,1558.8679,-1711.0403,5.6108,0.3289,0,1); // lspdcar 7
    PoliceCar[7] = AddStaticVehicle(596,1562.5826,-1710.9552,5.6119,0.3211,0,1); // lspdcar 8
    PoliceCar[8] = AddStaticVehicle(596,1566.0231,-1710.8680,5.6108,1.2654,0,1); // lspdcar 9
    PoliceCar[9] = AddStaticVehicle(596,1570.4457,-1710.6808,5.6110,1.1276,0,1); // lspdcar 10
    PoliceCar[10] = AddStaticVehicle(596,1574.5294,-1710.5968,5.6121,1.1661,0,1); // lspdcar 11
    Bis 32 noch...

    Hallo,
    wenn man kein SAPD Beamter ist kann man trz. mit dem Auto fahren.


    Code:



    public OnPlayerStateChange(playerid, newstate, oldstate)
    { new newcar = GetPlayerVehicleID(playerid);
    if(IsAMuelCar(newcar))
    {
    if(GetPVarInt(playerid,"Job") == 0)
    {
    SendClientMessage(playerid,rot,"Du bist kein Müllfahrer!");
    RemovePlayerFromVehicle(playerid);
    return 1;
    }
    }
    if(IsAPoliceCar(newcar))
    {
    if(GetPVarInt(playerid,"Fraktion") == 0)
    {
    SendClientMessage(playerid,rot,"Du bist kein Mitglied des SAPD!");
    RemovePlayerFromVehicle(playerid);
    return 1;
    }
    }
    return 1;
    }



    Nochmal zum vergleich habe ich das von dem Müllabfuhrwagen auch reingemacht weil da klappt es.


    MFG

    Hey,
    wenn man den Befehl /su eingibt dann kommt als:
    /su [Spielername/ID] [Anzahl] [Verbrechen]
    obwohl ich das alles mache.


    Code:



    ocmd:su(playerid,params[])
    {
    if(GetPVarInt(playerid,"Fraktion") == 1)
    {
    new pID, wanted, verbrechen, string[128], string2[128], string3[128];
    if(!IsPlayerConnected(pID)) return SendClientMessage(playerid,rot,"Der Spieler ist nicht online.");
    if(sscanf(params,"uis",pID,wanted))return SendClientMessage(playerid,rot,"/su [Spielername/ID] [Anzahl] [Verbrechen]");
    if(wanted<0||wanted>50)return SendClientMessage(playerid,rot,"Man kann nur von (0-50) Wanteds vergeben!");
    SetPVarInt(pID,"Wanted",wanted);
    SetPlayerWantedLevel(pID,wanted);
    SavePlayer(pID);
    format(string,sizeof(string),"Du hast ein Verbrechen begangen ( %s ). Reporter: %s.",verbrechen,SpielerName(playerid));
    SendClientMessage(pID,hellblau,string);
    format(string2,sizeof(string2),"Aktuelles Wantedlevel: %d",wanted);
    SendClientMessage(pID,gelb,string2);
    format(string3,sizeof(string3),"Du hast %d Wanteds gegeben.",SpielerName(pID));
    SendClientMessage(playerid,hellblau,string3);
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i) && GetPVarInt(playerid,"Fraktion") == 1)
    {
    format(string, sizeof(string), "** %s gibt %s, %d Wanteds.**",SpielerName(playerid),SpielerName(pID), wanted);
    SendClientMessage(i, 0x0000FFFF, string);
    format(string, sizeof(string), "** Verbrechen: %s ** Gesamt: %d **",verbrechen, wanted);
    SendClientMessage(i, 0x0000FFFF, string);
    PlayerPlaySound(i,2607,0,0,0);
    }
    }
    }
    else if(GetPVarInt(playerid,"Fraktion") == 0)
    {
    }
    return 1;
    }

    Hey,
    habe irgendeinen komischen Error:


    J:\Play your Life Selfmade\gamemodes\selfmade.pwn(1533) : error 029: invalid expression, assumed zero
    J:\Play your Life Selfmade\gamemodes\selfmade.pwn(1533) : warning 215: expression has no effect
    J:\Play your Life Selfmade\gamemodes\selfmade.pwn(1533) : warning 215: expression has no effect
    J:\Play your Life Selfmade\gamemodes\selfmade.pwn(1533) : warning 215: expression has no effect
    J:\Play your Life Selfmade\gamemodes\selfmade.pwn(1533) : warning 215: expression has no effect
    J:\Play your Life Selfmade\gamemodes\selfmade.pwn(1533) : warning 215: expression has no effect
    J:\Play your Life Selfmade\gamemodes\selfmade.pwn(1533) : error 001: expected token: ";", but found ")"
    J:\Play your Life Selfmade\gamemodes\selfmade.pwn(1533) : error 029: invalid expression, assumed zero
    J:\Play your Life Selfmade\gamemodes\selfmade.pwn(1533) : fatal error 107: too many error messages on one line


    Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    4 Errors.



    Zeile:


    ShowPlayerDialog(playerid,DIALOG_SAPDWAFFENSHOP,DIALOG_STYLE_LIST,"{FFBF00}SAPD Waffenshop","Desert Eagle (1000$)\nMP5 (500$)\nAK-47 (2000$)\nPfefferspray (250$)","Kaufen","Schließen");



    Der ganze Code:


    if(newkeys == KEY_SPRINT)
    {
    if(GetPVarInt(playerid,"Fraktion") == 1)
    {
    if(IsPlayerInRangeOfPoint(playerid,1.0,312.1588,-165.3566,999.6010))
    {
    ShowPlayerDialog(playerid,DIALOG_SAPDWAFFENSHOP,DIALOG_STYLE_LIST,"{FFBF00}SAPD Waffenshop","Desert Eagle (1000$)\nMP5 (500$)\nAK-47 (2000$)\nPfefferspray (250$)","Kaufen","Schließen");
    }
    }
    }