Jump to content

De ce nu merge sa ma spawnez ?


Recommended Posts

De ce nu merge sa ma spawnez ?
 

OnDialog()

  if(dialogid == Register)
 {
        new name[MAX_PLAYER_NAME], file[256], string[128];
        GetPlayerName(playerid, name, sizeof(name));
        format(file, sizeof(file), SAVE, name);
        new files[256];
        new one;
        one = 1;
        format(files, sizeof(files), "Server/Server.ini");
        if(!response) return Kick(playerid);
        if (!strlen(inputtext)) return
        ShowPlayerDialog(playerid, Register, DIALOG_STYLE_INPUT, "Salut, nu ai un cont!", "Te rog scrie o parola !", "Register", "Inchide");
        dini_Create(file);
        ServerInfo[playerid][sAccounts] = dini_Int(files, "Accounts");
        ServerInfo[playerid][sAccounts] = ServerInfo[playerid][sAccounts]+one;
        dini_IntSet(files, "Accounts", ServerInfo[playerid][sAccounts]);
        dini_IntSet(file, "Password", udb_hash(inputtext));
        dini_IntSet(file, "AdminLevel", PlayerInfo[playerid][pAdminLevel] = 0);
        dini_IntSet(file, "Money", PlayerInfo[playerid][pMoney] = 15000);
        dini_IntSet(file, "Score", PlayerInfo[playerid][pScore] = 0);
        dini_IntSet(file, "Bonus", PlayerInfo[playerid][pBonus] = 0);
        dini_IntSet(file, "FierVechi", PlayerInfo[playerid][pFier] = 0);
        dini_IntSet(file, "Permis", PlayerInfo[playerid][pPermis] = 0);
        dini_IntSet(file, "LicentaDeArma", PlayerInfo[playerid][pArma] = 0);
        dini_IntSet(file, "Gift", PlayerInfo[playerid][pGift] = 0);
        dini_IntSet(file, "cGift", PlayerInfo[playerid][pCGift] = 0);
        dini_IntSet(file, "Crate", PlayerInfo[playerid][pCrate] = 0);
        dini_IntSet(file, "Ban", PlayerInfo[playerid][pBan] = 0);
        dini_IntSet(file, "Diamonds", PlayerInfo[playerid][pDiamonds] = 0);
        dini_IntSet(file, "DatorLaBanca", PlayerInfo[playerid][pDator] = 0);
        dini_IntSet(file, "SumaBanca", PlayerInfo[playerid][pSumaBanca] = 0);
        dini_IntSet(file, "TimpRata", PlayerInfo[playerid][pTimpRata] = -1);
        dini_IntSet(file, "GiftPoints", PlayerInfo[playerid][pGiftPoints] = 0);
        dini_IntSet(file, "VIP", PlayerInfo[playerid][pVip] = 0);
        dini_IntSet(file, "Masina", PlayerInfo[playerid][pMasina] = 0);
        dini_IntSet(file, "ID", PlayerInfo[playerid][pID] = sAccounts);
        format(string, sizeof(string), "Te-ai inregistrat cu succes, %s !", name);
        gPlayerLogged[playerid] = 1;
        GivePlayerMoney(playerid, 15000);
        SetSpawnInfo(playerid, 0, 60, xspawn, yspawn, zspawn, 0, 0, 0, 0, 0, 0, 0); 
        SpawnPlayer(playerid);
        SendClientMessage(playerid, COLOR_YELLOW, string);
        SendClientMessage(playerid, 0x0077ffFF, "Salut ! Bine ai venit !");
        SendClientMessage(playerid, 0x0077ffFF, "Pentru inceput vreau sa iti spun ca ownerul acestui server este GamerulFOX !");
        SendClientMessage(playerid, 0x0077ffFF, "Daca ai o problema/Vrei sa raportezi un bug trimite un report !");
        SendClientMessage(playerid, 0x0077ffFF, "Pe acest server se v-or acorda bonusuri zilnic !");
        SendClientMessage(playerid, 0x0077ffFF, "Echipa OldTimes, iti ureaza un joc cat mai placut !");
        SetPlayerColor(playerid, 0x555755FF);
        SetPlayerVirtualWorld(playerid, 0);
        }
  if(dialogid == Login)
 {
        new name[MAX_PLAYER_NAME], file[256];
        GetPlayerName(playerid, name, sizeof(name));
        format(file, sizeof(file), SAVE, name);
        if(!response) return Kick(playerid);
        if (!strlen(inputtext)) return ShowPlayerDialog(playerid, Login, DIALOG_STYLE_INPUT, "Salut, ai un cont", "Te rog scrie parola !", "Login", "Inchide");
        new tmp;
        tmp = dini_Int(file, "Password");
        if(udb_hash(inputtext) != tmp) {
        SendClientMessage(playerid, COLOR_RED, "Parola Gresita !.");
        ShowPlayerDialog(playerid, Login, DIALOG_STYLE_INPUT, "Salut, ai deja un cont!", "Te rog scrie parola !", "Login", "Inchide");
        }
        else
        {
        gPlayerLogged[playerid] = 1;
        PlayerInfo[playerid][pAdminLevel] = dini_Int(file, "AdminLevel");
        SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
        GivePlayerMoney(playerid, dini_Int(file, "Money")-GetPlayerMoney(playerid));
        PlayerInfo[playerid][pFier] = dini_Int(file, "FierVechi");
        PlayerInfo[playerid][pArma] = dini_Int(file, "LicentaDeArma");
        PlayerInfo[playerid][pGift] = dini_Int(file, "Gift");
        PlayerInfo[playerid][pCGift] = dini_Int(file, "cGift");
        PlayerInfo[playerid][pCrate] = dini_Int(file, "Crate");
        PlayerInfo[playerid][pDiamonds] = dini_Int(file, "Diamonds");
        PlayerInfo[playerid][pDator] = dini_Int(file, "DatorLaBanca");
        PlayerInfo[playerid][pSumaBanca] = dini_Int(file, "SumaBanca");
        PlayerInfo[playerid][pTimpRata] = dini_Int(file, "TimpRata");
        PlayerInfo[playerid][pGiftPoints] = dini_Int(file, "GiftPoints");
        PlayerInfo[playerid][pVip] =  dini_Int(file, "VIP");
        PlayerInfo[playerid][pMasina] = dini_Int(file, "Masina");
        PlayerInfo[playerid][pID] = dini_Int(file, "ID");
        if(PlayerInfo[playerid][pTimpRata] == 3){
          SendClientMessage(playerid, 0x10d4deff, "Din pacate nu ai platit rata la timp!");
          GivePlayerMoney(playerid, -GetPlayerMoney(playerid));
          PlayerInfo[playerid][pDator] = 0;
          PlayerInfo[playerid][pSumaBanca] = 0;
          PlayerInfo[playerid][pTimpRata] = -1;
          dini_IntSet(file, "DatorLaBanca", PlayerInfo[playerid][pDator]);
          dini_IntSet(file, "SumaBanca", PlayerInfo[playerid][pSumaBanca]);
          dini_IntSet(file, "TimpRata", PlayerInfo[playerid][pTimpRata]);
        }
        if(PlayerInfo[playerid][pDator] == 1) PlayerInfo[playerid][pTimpRata]++;
        SetSpawnInfo(playerid, 0, 60, xspawn, yspawn, zspawn, 0, 0, 0, 0, 0, 0, 0); 
        SendClientMessage(playerid, COLOR_RED, "Te-ai logat cu succes!");
        SpawnPlayer(playerid);
        if(PlayerInfo[playerid][pAdminLevel] > 0) SetPlayerColor(playerid, COLOR_RED);
        SetPlayerVirtualWorld(playerid, 0);
        }
        }



OnGameModeInit



AddPlayerClass(60, 245.5034, 1856.5551, 8.7569, 269.1425, 0, 0, 0, 0, 0, 0);




public OnPlayerConnect(playerid)
{
    gPlayerLogged[playerid] = 0;
    new name[MAX_PLAYER_NAME], file[256];
    GetPlayerName(playerid, name, sizeof(name));
    format(file, sizeof(file), SAVE, name);
    if(!dini_Exists(file))
    {
        TextDrawShowForPlayer(playerid, TDELogin_TD[0]);
        TextDrawShowForPlayer(playerid, TDELogin_TD[1]);
        format(ReportText[playerid], 256, "None");
        UpdateSpeed[playerid] = false;
        SpdObj[playerid][0] = INVALID_OBJECT_ID;
        SpdObj[playerid][1] = INVALID_OBJECT_ID;
        PlayerJob[playerid] = 0;
        Checkpoint[playerid] = 0;
        JobVehicle[playerid] = 0;
        JobWorking[playerid] = 0;
        PlayerJob1[playerid] = 0;
        Checkpoint1[playerid] = 0;
        JobVehicle1[playerid] = 0;
        JobWorking1[playerid] = 0;
        PlayerJob2[playerid] = 0;
        Checkpoint2[playerid] = 0;
        JobVehicle2[playerid] = 0;
        JobWorking2[playerid] = 0;
        CursaCheckpoint[playerid] = 0;
        CursaCar[playerid] = 0;
        Report[playerid] = 0;
        masinaadmin[playerid] = 0;
        Event[playerid] = 0;
        pEvent[playerid] = 0;
        Gift[playerid] = 0;
        GiftC[playerid] = 0;
        Bonus[playerid] = 0;
        SpecialQuest[playerid] = 0;
        SpecialQuestCheckpoint[playerid] = 0;
        Salutare[playerid] = 0;
        DrivingCheckpoint[playerid] = 0;
        MasinaDMV[playerid] = 0;
        fPolitie[playerid] = 0;
        fMedic[playerid] = 0;
        fTaxi[playerid] = 0;
        fProTv[playerid] = 0;
        IsInCar[playerid] = 0;
        gPlayerLogged[playerid] = 0;
        ShowPlayerDialog(playerid, Register, DIALOG_STYLE_INPUT, "Salut, nu ai un cont!", "Te rog scrie o parola !", "Register", "Inchide");
    }
    if(fexist(file))
    {
        if(PlayerInfo[playerid][pBan] == 1){
            SendClientMessage(playerid, 0xff0000FF, "Esti Banat !");
            Kick(playerid);
            return 1;
        }
        TextDrawShowForPlayer(playerid, TDELogin_TD[0]);
        TextDrawShowForPlayer(playerid, TDELogin_TD[1]);
        format(ReportText[playerid], 256, "None");
        UpdateSpeed[playerid] = false;
        SpdObj[playerid][0] = INVALID_OBJECT_ID;
        SpdObj[playerid][1] = INVALID_OBJECT_ID;
        PlayerJob[playerid] = 0;
        Checkpoint[playerid] = 0;
        JobVehicle[playerid] = 0;
        JobWorking[playerid] = 0;
        PlayerJob1[playerid] = 0;
        Checkpoint1[playerid] = 0;
        JobVehicle1[playerid] = 0;
        JobWorking1[playerid] = 0;
        PlayerJob2[playerid] = 0;
        Checkpoint2[playerid] = 0;
        JobVehicle2[playerid] = 0;
        JobWorking2[playerid] = 0;
        CursaCheckpoint[playerid] = 0;
        CursaCar[playerid] = 0;
        Report[playerid] = 0;
        masinaadmin[playerid] = 0;
        Event[playerid] = 0;
        pEvent[playerid] = 0;
        Gift[playerid] = 0;
        GiftC[playerid] = 0;
        Bonus[playerid] = 0;
        SpecialQuest[playerid] = 0;
        SpecialQuestCheckpoint[playerid] = 0;
        Salutare[playerid] = 0;
        DrivingCheckpoint[playerid] = 0;
        MasinaDMV[playerid] = 0;
        fPolitie[playerid] = 0;
        fMedic[playerid] = 0;
        fTaxi[playerid] = 0;
        fProTv[playerid] = 0;
        IsInCar[playerid] = 0;
        gPlayerLogged[playerid] = 0;
        ShowPlayerDialog(playerid, Register, DIALOG_STYLE_INPUT, "Salut, nu ai un cont!", "Te rog scrie o parola !", "Register", "Inchide");
    }
    return 1;
}



doar astea

Link to comment
Share on other sites

On 6/27/2022 at 11:57 AM, GamerulFOX said:

De ce nu merge sa ma spawnez ?
 

OnDialog()

  if(dialogid == Register)
 {
        new name[MAX_PLAYER_NAME], file[256], string[128];
        GetPlayerName(playerid, name, sizeof(name));
        format(file, sizeof(file), SAVE, name);
        new files[256];
        new one;
        one = 1;
        format(files, sizeof(files), "Server/Server.ini");
        if(!response) return Kick(playerid);
        if (!strlen(inputtext)) return
        ShowPlayerDialog(playerid, Register, DIALOG_STYLE_INPUT, "Salut, nu ai un cont!", "Te rog scrie o parola !", "Register", "Inchide");
        dini_Create(file);
        ServerInfo[playerid][sAccounts] = dini_Int(files, "Accounts");
        ServerInfo[playerid][sAccounts] = ServerInfo[playerid][sAccounts]+one;
        dini_IntSet(files, "Accounts", ServerInfo[playerid][sAccounts]);
        dini_IntSet(file, "Password", udb_hash(inputtext));
        dini_IntSet(file, "AdminLevel", PlayerInfo[playerid][pAdminLevel] = 0);
        dini_IntSet(file, "Money", PlayerInfo[playerid][pMoney] = 15000);
        dini_IntSet(file, "Score", PlayerInfo[playerid][pScore] = 0);
        dini_IntSet(file, "Bonus", PlayerInfo[playerid][pBonus] = 0);
        dini_IntSet(file, "FierVechi", PlayerInfo[playerid][pFier] = 0);
        dini_IntSet(file, "Permis", PlayerInfo[playerid][pPermis] = 0);
        dini_IntSet(file, "LicentaDeArma", PlayerInfo[playerid][pArma] = 0);
        dini_IntSet(file, "Gift", PlayerInfo[playerid][pGift] = 0);
        dini_IntSet(file, "cGift", PlayerInfo[playerid][pCGift] = 0);
        dini_IntSet(file, "Crate", PlayerInfo[playerid][pCrate] = 0);
        dini_IntSet(file, "Ban", PlayerInfo[playerid][pBan] = 0);
        dini_IntSet(file, "Diamonds", PlayerInfo[playerid][pDiamonds] = 0);
        dini_IntSet(file, "DatorLaBanca", PlayerInfo[playerid][pDator] = 0);
        dini_IntSet(file, "SumaBanca", PlayerInfo[playerid][pSumaBanca] = 0);
        dini_IntSet(file, "TimpRata", PlayerInfo[playerid][pTimpRata] = -1);
        dini_IntSet(file, "GiftPoints", PlayerInfo[playerid][pGiftPoints] = 0);
        dini_IntSet(file, "VIP", PlayerInfo[playerid][pVip] = 0);
        dini_IntSet(file, "Masina", PlayerInfo[playerid][pMasina] = 0);
        dini_IntSet(file, "ID", PlayerInfo[playerid][pID] = sAccounts);
        format(string, sizeof(string), "Te-ai inregistrat cu succes, %s !", name);
        gPlayerLogged[playerid] = 1;
        GivePlayerMoney(playerid, 15000);
        SetSpawnInfo(playerid, 0, 60, xspawn, yspawn, zspawn, 0, 0, 0, 0, 0, 0, 0); 
        SpawnPlayer(playerid);
        SendClientMessage(playerid, COLOR_YELLOW, string);
        SendClientMessage(playerid, 0x0077ffFF, "Salut ! Bine ai venit !");
        SendClientMessage(playerid, 0x0077ffFF, "Pentru inceput vreau sa iti spun ca ownerul acestui server este GamerulFOX !");
        SendClientMessage(playerid, 0x0077ffFF, "Daca ai o problema/Vrei sa raportezi un bug trimite un report !");
        SendClientMessage(playerid, 0x0077ffFF, "Pe acest server se v-or acorda bonusuri zilnic !");
        SendClientMessage(playerid, 0x0077ffFF, "Echipa OldTimes, iti ureaza un joc cat mai placut !");
        SetPlayerColor(playerid, 0x555755FF);
        SetPlayerVirtualWorld(playerid, 0);
        }
  if(dialogid == Login)
 {
        new name[MAX_PLAYER_NAME], file[256];
        GetPlayerName(playerid, name, sizeof(name));
        format(file, sizeof(file), SAVE, name);
        if(!response) return Kick(playerid);
        if (!strlen(inputtext)) return ShowPlayerDialog(playerid, Login, DIALOG_STYLE_INPUT, "Salut, ai un cont", "Te rog scrie parola !", "Login", "Inchide");
        new tmp;
        tmp = dini_Int(file, "Password");
        if(udb_hash(inputtext) != tmp) {
        SendClientMessage(playerid, COLOR_RED, "Parola Gresita !.");
        ShowPlayerDialog(playerid, Login, DIALOG_STYLE_INPUT, "Salut, ai deja un cont!", "Te rog scrie parola !", "Login", "Inchide");
        }
        else
        {
        gPlayerLogged[playerid] = 1;
        PlayerInfo[playerid][pAdminLevel] = dini_Int(file, "AdminLevel");
        SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
        GivePlayerMoney(playerid, dini_Int(file, "Money")-GetPlayerMoney(playerid));
        PlayerInfo[playerid][pFier] = dini_Int(file, "FierVechi");
        PlayerInfo[playerid][pArma] = dini_Int(file, "LicentaDeArma");
        PlayerInfo[playerid][pGift] = dini_Int(file, "Gift");
        PlayerInfo[playerid][pCGift] = dini_Int(file, "cGift");
        PlayerInfo[playerid][pCrate] = dini_Int(file, "Crate");
        PlayerInfo[playerid][pDiamonds] = dini_Int(file, "Diamonds");
        PlayerInfo[playerid][pDator] = dini_Int(file, "DatorLaBanca");
        PlayerInfo[playerid][pSumaBanca] = dini_Int(file, "SumaBanca");
        PlayerInfo[playerid][pTimpRata] = dini_Int(file, "TimpRata");
        PlayerInfo[playerid][pGiftPoints] = dini_Int(file, "GiftPoints");
        PlayerInfo[playerid][pVip] =  dini_Int(file, "VIP");
        PlayerInfo[playerid][pMasina] = dini_Int(file, "Masina");
        PlayerInfo[playerid][pID] = dini_Int(file, "ID");
        if(PlayerInfo[playerid][pTimpRata] == 3){
          SendClientMessage(playerid, 0x10d4deff, "Din pacate nu ai platit rata la timp!");
          GivePlayerMoney(playerid, -GetPlayerMoney(playerid));
          PlayerInfo[playerid][pDator] = 0;
          PlayerInfo[playerid][pSumaBanca] = 0;
          PlayerInfo[playerid][pTimpRata] = -1;
          dini_IntSet(file, "DatorLaBanca", PlayerInfo[playerid][pDator]);
          dini_IntSet(file, "SumaBanca", PlayerInfo[playerid][pSumaBanca]);
          dini_IntSet(file, "TimpRata", PlayerInfo[playerid][pTimpRata]);
        }
        if(PlayerInfo[playerid][pDator] == 1) PlayerInfo[playerid][pTimpRata]++;
        SetSpawnInfo(playerid, 0, 60, xspawn, yspawn, zspawn, 0, 0, 0, 0, 0, 0, 0); 
        SendClientMessage(playerid, COLOR_RED, "Te-ai logat cu succes!");
        SpawnPlayer(playerid);
        if(PlayerInfo[playerid][pAdminLevel] > 0) SetPlayerColor(playerid, COLOR_RED);
        SetPlayerVirtualWorld(playerid, 0);
        }
        }



OnGameModeInit



AddPlayerClass(60, 245.5034, 1856.5551, 8.7569, 269.1425, 0, 0, 0, 0, 0, 0);




public OnPlayerConnect(playerid)
{
    gPlayerLogged[playerid] = 0;
    new name[MAX_PLAYER_NAME], file[256];
    GetPlayerName(playerid, name, sizeof(name));
    format(file, sizeof(file), SAVE, name);
    if(!dini_Exists(file))
    {
        TextDrawShowForPlayer(playerid, TDELogin_TD[0]);
        TextDrawShowForPlayer(playerid, TDELogin_TD[1]);
        format(ReportText[playerid], 256, "None");
        UpdateSpeed[playerid] = false;
        SpdObj[playerid][0] = INVALID_OBJECT_ID;
        SpdObj[playerid][1] = INVALID_OBJECT_ID;
        PlayerJob[playerid] = 0;
        Checkpoint[playerid] = 0;
        JobVehicle[playerid] = 0;
        JobWorking[playerid] = 0;
        PlayerJob1[playerid] = 0;
        Checkpoint1[playerid] = 0;
        JobVehicle1[playerid] = 0;
        JobWorking1[playerid] = 0;
        PlayerJob2[playerid] = 0;
        Checkpoint2[playerid] = 0;
        JobVehicle2[playerid] = 0;
        JobWorking2[playerid] = 0;
        CursaCheckpoint[playerid] = 0;
        CursaCar[playerid] = 0;
        Report[playerid] = 0;
        masinaadmin[playerid] = 0;
        Event[playerid] = 0;
        pEvent[playerid] = 0;
        Gift[playerid] = 0;
        GiftC[playerid] = 0;
        Bonus[playerid] = 0;
        SpecialQuest[playerid] = 0;
        SpecialQuestCheckpoint[playerid] = 0;
        Salutare[playerid] = 0;
        DrivingCheckpoint[playerid] = 0;
        MasinaDMV[playerid] = 0;
        fPolitie[playerid] = 0;
        fMedic[playerid] = 0;
        fTaxi[playerid] = 0;
        fProTv[playerid] = 0;
        IsInCar[playerid] = 0;
        gPlayerLogged[playerid] = 0;
        ShowPlayerDialog(playerid, Register, DIALOG_STYLE_INPUT, "Salut, nu ai un cont!", "Te rog scrie o parola !", "Register", "Inchide");
    }
    if(fexist(file))
    {
        if(PlayerInfo[playerid][pBan] == 1){
            SendClientMessage(playerid, 0xff0000FF, "Esti Banat !");
            Kick(playerid);
            return 1;
        }
        TextDrawShowForPlayer(playerid, TDELogin_TD[0]);
        TextDrawShowForPlayer(playerid, TDELogin_TD[1]);
        format(ReportText[playerid], 256, "None");
        UpdateSpeed[playerid] = false;
        SpdObj[playerid][0] = INVALID_OBJECT_ID;
        SpdObj[playerid][1] = INVALID_OBJECT_ID;
        PlayerJob[playerid] = 0;
        Checkpoint[playerid] = 0;
        JobVehicle[playerid] = 0;
        JobWorking[playerid] = 0;
        PlayerJob1[playerid] = 0;
        Checkpoint1[playerid] = 0;
        JobVehicle1[playerid] = 0;
        JobWorking1[playerid] = 0;
        PlayerJob2[playerid] = 0;
        Checkpoint2[playerid] = 0;
        JobVehicle2[playerid] = 0;
        JobWorking2[playerid] = 0;
        CursaCheckpoint[playerid] = 0;
        CursaCar[playerid] = 0;
        Report[playerid] = 0;
        masinaadmin[playerid] = 0;
        Event[playerid] = 0;
        pEvent[playerid] = 0;
        Gift[playerid] = 0;
        GiftC[playerid] = 0;
        Bonus[playerid] = 0;
        SpecialQuest[playerid] = 0;
        SpecialQuestCheckpoint[playerid] = 0;
        Salutare[playerid] = 0;
        DrivingCheckpoint[playerid] = 0;
        MasinaDMV[playerid] = 0;
        fPolitie[playerid] = 0;
        fMedic[playerid] = 0;
        fTaxi[playerid] = 0;
        fProTv[playerid] = 0;
        IsInCar[playerid] = 0;
        gPlayerLogged[playerid] = 0;
        ShowPlayerDialog(playerid, Register, DIALOG_STYLE_INPUT, "Salut, nu ai un cont!", "Te rog scrie o parola !", "Register", "Inchide");
    }
    return 1;
}



doar astea

dami add pe discord sa te ajut ! 

 Încearcă să fii un om de valoare și nu neapărat un om de succes.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.