Spawn waffe

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
  • stock Register(playerid,key[])
    {
    new PlayerDatei[64];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(PlayerDatei,sizeof(PlayerDatei),"/Accounts/%s.txt",name);
    dini_Create(PlayerDatei);
    dini_Set(PlayerDatei,"Passwort",key);
    SendClientMessage(playerid,WEISS,"DM 4 Life wünscht dir viel Spaß!!");
    SendClientMessage(playerid,ORANGE,"Geld kannst du verdienen in dem du jemanden Killst oder das BSN ausraubst Tippe: /help");
    SetPlayerScore(playerid,0);
    SetPVarInt(playerid,"firstlog",0);
    SetPVarInt(playerid,"loggedin",1);
    SetPVarInt(playerid,"Premium",1);
    SetPVarInt(playerid,"Job",0);
    SetPVarInt(playerid,"Geld",20000);
    return 1;
    }


    stock Login(playerid,key[])
    {
    new PlayerDatei[64];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(PlayerDatei,sizeof(PlayerDatei),"/Accounts/%s.txt",name);


    if(gettime()<dini_Int(PlayerDatei,"timeban"))
    {
    SendClientMessage(playerid,ROT,"Du hast noch einen Timeban versuche es Später nochmal!");
    Kick(playerid);
    return 1;
    }
    if(!strcmp(key,dini_Get(PlayerDatei,"Passwort"),false))
    {
    LoadAccount(playerid);
    return 1;
    }
    else
    {
    SendClientMessage(playerid,HELLROT,"Du hast ein falsches Passwort eingeben!");
    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Du bist bereits Regestriert, gib dein Passwort ein!","Login","Abbrechen");
    SetPVarInt(playerid,"firstlog",1);
    SetPVarInt(playerid,"loggdin",2);
    return 1;
    }
    }


    stock LoadAccount(playerid)
    {
    new PlayerDatei[64];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(PlayerDatei,sizeof(PlayerDatei),"/Accounts/%s.txt",name);
    SetPlayerScore(playerid,dini_Int(PlayerDatei,"Kills"));
    GivePlayerMoney(playerid,dini_Int(PlayerDatei,"Geld"));
    SetPVarInt(playerid,"Waffen",dini_Int(PlayerDatei,"Waffen"));
    SetPVarInt(playerid,"Adminlevel",dini_Int(PlayerDatei,"Adminlevel"));
    SetPVarInt(playerid,"Baned",dini_Int(PlayerDatei,"Baned"));
    SetPVarInt(playerid,"Warn",dini_Int(PlayerDatei,"Warn"));
    SetPVarInt(playerid,"Kills",dini_Int(PlayerDatei,"Kills"));
    SetPVarInt(playerid,"Tode",dini_Int(PlayerDatei,"Tode"));
    SetPVarInt(playerid,"Score",dini_Int(PlayerDatei,"Score"));
    SetPVarInt(playerid,"Mute",dini_Int(PlayerDatei,"Mute"));
    SetPVarInt(playerid,"FiStyle",dini_Int(PlayerDatei,"FiStyle"));
    SetPVarInt(playerid,"Tickets",dini_Int(PlayerDatei,"Tickets"));
    SetPVarInt(playerid,"Fraktion",dini_Int(PlayerDatei,"Fraktion"));
    SetPVarInt(playerid,"Rang",dini_Int(PlayerDatei,"Rang"));
    SetPVarInt(playerid,"Geschlecht",dini_Int(PlayerDatei,"Geschlecht"));
    SetPVarInt(playerid,"firstlog",dini_Int(PlayerDatei,"firstlog"));
    SetPVarInt(playerid,"Premium",dini_Int(PlayerDatei,"Premium"));
    SetPVarInt(playerid,"Job",dini_Int(PlayerDatei,"Job"));


    if(GetPVarInt(playerid,"Baned")==1)
    {
    SendClientMessage(playerid,ROT,"Du bist permanent vom Server Gebannt!!.");
    Kick(playerid);
    }
    if(GetPVarInt(playerid,"Warn")==3)
    {
    SendClientMessage(playerid,ROT,"Du hast 3Verwarnung und bis ab jetzt Gebannt!.");
    SendClientMessage(playerid,ROT,"Um entbannt zu werden melde dich bite im TS oder im Forum");
    Kick(playerid);
    }
    SetPVarInt(playerid,"loggedin",1);
    return 1;
    }


    stock PlayerSpeichern(playerid)
    {
    if(GetPVarInt(playerid,"loggedin")==1)
    {
    new PlayerDatei[64];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    format(PlayerDatei,sizeof(PlayerDatei),"/Accounts/%s.txt",name);
    dini_IntSet(PlayerDatei,"Geld",GetPlayerMoney(playerid));
    dini_IntSet(PlayerDatei,"Waffen",GetPlayerWeapon(playerid));
    dini_IntSet(PlayerDatei,"Adminlevel",GetPVarInt(playerid,"Adminlevel"));
    dini_IntSet(PlayerDatei,"Baned",GetPVarInt(playerid,"Baned"));
    dini_IntSet(PlayerDatei,"timeban",GetPVarInt(playerid,"timeban"));
    dini_IntSet(PlayerDatei,"Warn",GetPVarInt(playerid,"Warn"));
    dini_IntSet(PlayerDatei,"Kills",GetPlayerScore(playerid));
    dini_IntSet(PlayerDatei,"Tode",GetPVarInt(playerid,"Tode"));
    dini_IntSet(PlayerDatei,"Score",GetPlayerScore(playerid));
    dini_IntSet(PlayerDatei,"Mute",GetPVarInt(playerid,"Mute"));
    dini_IntSet(PlayerDatei,"FiStyle",GetPlayerFightingStyle(playerid));
    dini_IntSet(PlayerDatei,"Tickes",GetPVarInt(playerid,"Tickets"));
    dini_IntSet(PlayerDatei,"Fraktion",GetPVarInt(playerid,"Fraktion"));
    dini_IntSet(PlayerDatei,"Rang",GetPVarInt(playerid,"Rang"));
    dini_IntSet(PlayerDatei,"Geschlecht",GetPVarInt(playerid,"Geschlecht"));
    dini_IntSet(PlayerDatei,"firstlog",GetPVarInt(playerid,"firstlog"));
    dini_IntSet(PlayerDatei,"Premium",GetPVarInt(playerid,"Premium"));
    dini_IntSet(PlayerDatei,"Job",GetPVarInt(playerid,"Job"));
    dini_IntSet(PlayerDatei,"Baned",GetPVarInt(playerid,"Baned"));
    }
    return 1;
    }