Jump to content

BaFFyJunior

Membru
  • Posts

    240
  • Joined

  • Last visited

  • Days Won

    4

Posts posted by BaFFyJunior

  1. Acum 27 minute, Anexy a spus:

    imi poti explica te rog cum fac asta?

    Poti pune intr-un timer o data/secunda sau nu stiu, o data la 10 secunde... o data pe minut, cum vrei tu, cu foreach sa verifice daca jucatorul are destule rp pentru level up si sa ii dea level up. 

    Exemplu:

    foreach(new i: Player)
    {
      if(PlayerInfo[i][pRP] == PlayerInfo[i][pRPNecesar])
      {
     	 PlayerInfo[i][pLevel] ++;
    	//aici mai pui ce completari vrei tu, inlocuiesti cu ce variabile ai tu in gamemode.
      }
    }

    Nu am scriptat pe gamemode rpg de multa vreme, nu mai stiu exact cum se numesc variabilele :)) Pe langa asta, difera de la server la server. Inlocuieste cu ce ai tu si cu ce verificari mai vrei, mai sus ai un exemplu teoretic. Sper ca ai inteles.

  2. Foloseste functia ProxDetector. La OnPlayerText unde trimite mesajul sterge SendClientMessageToAll sau foreach sau ce folosesti si pune ProxDetector.

    function ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5) {
        new Float:posx, Float:posy, Float:posz;
        new Float:oldposx, Float:oldposy, Float:oldposz;
        new Float:tempposx, Float:tempposy, Float:tempposz;
        GetPlayerPos(playerid, oldposx, oldposy, oldposz);
        foreach(new i: Player) {
            if(GetPlayerInterior(playerid) == GetPlayerInterior(i) && GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)) {
                    GetPlayerPos(i, posx, posy, posz);
                    tempposx = (oldposx -posx);
                    tempposy = (oldposy -posy);
                    tempposz = (oldposz -posz);
                    if(((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
                        SCM(i, col1, string);
                    else if(((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
                        SCM(i, col2, string);
                    else if(((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
                        SCM(i, col3, string);
                    else if(((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
                        SCM(i, col4, string);
                    else if(((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
                        SCM(i, col5, string);
    
            }
        }
        return true;
    }

     

  3. Acum 3 ore, Anexy a spus:

    vreau sa fac sa nu apara acolo si nici sa nu se se consume adica sa fie fara benzina

    In functie pui if(IsABike(vehicleid)) return 1; inainte de variabila combustibilului care scade sau poti face sa verifice daca e bike sa nu scada adica pui {}, iar cu else sa scada... cum vrei. Sper ca ai inteles.

  4. Acum 1 oră, k1ll3rhawk a spus:

    Salut, am nevoie sa stiu cum fac ca in baza de date, la users, la fiecare user sa fie creat o noua linie, spre exemplu cum e level sau money sa am alta linie pentru un numar cum ar fi credit la telefon, cum fac sa adaug aceasta linie in baza de date din gm?

    Alegi tabelul users din baza de date, apoi alegi de sus Structure, mergi jos si vei vedea add column after x.

  5. Salutari! Am un server de samp intitulat National Trucking. Avem o medie de 30 playeri on zilnic, hosted tab activ... parca tot nu este asa de bine. Totusi, nu ma pot plange. Stiti niste youtuberi care se ocupa de promovari? Eu am cautat, dar din pacate nu am primit niciun raspuns. O seara faina va doresc!

  6. Cu o functie simpla.
     

    stock GetRankAdmin( rank )
    {
        new Rankname[ 55 ];
    
        switch( rank )
        {
            case 0: Rankname = "Player";
            case 1: Rankname = "Junior-Admin";
            case 2: Rankname = "Senior-Admin";
            case 3: Rankname = "Head Admin";
            case 4: Rankname = "Master-Admin";
            case 5: Rankname = "Co-Fondator";
            case 6: Rankname = "Fondator";
            case 7: Rankname = "Scripter";
        }
        return ( Rankname ) ;
    }

    O folosesti in sintaxa asa: GetRankAdmin(PlayerInfo[playerid][pAdmin]). Ex:
     

    new string[64];
    format(string, sizeof(string), "%s %s a dat 15000$.", GetRankAdmin(PlayerInfo[playerid][pAdmin]), GetName(playerid));

    Sper ca te-am ajutat.

  7. Acum 2 ore, Aladdin a spus:

    Si mai exact, ce compilam cu pawno ca vad ca il am inca in GM, si ce faceam cu fisierele compilate, le urcam pe filezilla ?

    Compilezi cu pawno fisierele .pwn din filterscripts sau gamemodes. Da, fisierele le urci pe gamemode prin filezilla. Fisierele luat in considerare de host sunt cele de tip .amx.

  8. Ca host recomand ultra-h Germania. Ai nevoie de fillezilla pentru a urca fisierele pe host cu un cont ftp oferit de host... si pawno ca si compilator(poti folosi si zeex sau ce vrei tu). Daca contul e pe mysql si de o baza de date. Pe ultra-h e inclusa in pret.

  9. Acum 3 ore, Razvan Balan a spus:

    EDIT: doar prima, la restul am vazut ca am gresit un simbol

    D:\Users\razvan\Desktop\gmddadada\gamemode\gamemodes\gm.pwn(53276) : error 021: symbol already defined: "RACtime"
    D:\Users\razvan\Desktop\gmddadada\gamemode\gamemodes\gm.pwn(53279) : error 001: expected token: "]", but found "ă"
    D:\Users\razvan\Desktop\gmddadada\gamemode\gamemodes\gm.pwn(53279) : error 029: invalid expression, assumed zero
    D:\Users\razvan\Desktop\gmddadada\gamemode\gamemodes\gm.pwn(53279) : error 029: invalid expression, assumed zero
    D:\Users\razvan\Desktop\gmddadada\gamemode\gamemodes\gm.pwn(53279) : fatal error 107: too many error messages on one line

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


    5 Errors.

    Imi da eroare

    Inlocuieste functia RACtime din gm cu functia data de mine. De asemenea, verifica daca cOwned exista la enum cInfo. Daca tot primesti erori posteaza si linia erorii.

  10. Acum 10 ore, jAMAiCA. a spus:

    Am incercat implementarea comenzii asteia in gm bh by hpq123, ii dau admin 1 si nu merge, nu se salveaza, cand intra pe server nu are admin. Daca imi puteti spune ce e gresit.

    YCMD:setadminoff(playerid, params[]) {
        if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, -1, AdminOnly);
        new id[64], adminlevel, userid, string[200];
        if(sscanf(params, "s[64]i", id, adminlevel)) return SendClientMessage(playerid, COLOR_WHITE, "{33CCFF}Sintaxa: {FFFFFF}/setadminoff <Name> <Admin Level>");
        new cont = MySQLCheckAccount(id);
        userid = GetPlayerID(id);
        if(cont == 0) return SCM(playerid, -1, "Eroare: Acest nume nu a fost gasit in baza de date!");
        if(adminlevel < 0 || adminlevel > 6) return SCM(playerid, COLOR_GREY, "Invalid admin level! (0-6)");

        format(string, sizeof(string), "I-ai setat lui %s admin %d.", id, adminlevel);
        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
        format(string, sizeof(string), "AdmCmd: %s i-a setat lui (Offline)%s admin %d.", GetName(playerid), id, adminlevel);
        if(GetPVarInt(playerid, "Cover") == 0) SendAdminMessage(COLOR_LOGS, string, 6);
        
        PlayerInfo[userid][pAdmin] = adminlevel;

        new query[180];
        
        if(adminlevel >= 1) format(query, sizeof(query), "UPDATE users SET `Security`='%s', `HelpedPlayers`='0', `Admin`='%s' WHERE `name`='%s'", MD5_Hash(DEFAULT_PASSWORD), adminlevel, userid);
        else format(query, sizeof(query), "UPDATE users SET `AW`='0', `Admin`='0' WHERE `name`='%s'", userid);
        mysql_query(SQL, query);
        return 1;
    }

    Verifica mysql_log.

    new query[180];
    if(adminlevel >= 1) format(query, sizeof(query), "UPDATE users SET `Security`='%s', `HelpedPlayers`='0', `Admin`='%d' WHERE `id`='%d'", MD5_Hash(DEFAULT_PASSWORD), adminlevel, userid);
    else format(query, sizeof(query), "UPDATE users SET `AW`='0', `Admin`='0' WHERE `id`='%d'", userid);
    mysql_query(SQL, query);

     

  11. Acum 23 minute, Razvan Balan a spus:

    Ce mi ai pus tu, pun dupa adica mai jos?

    Da, in gamemode unde vrei. Dar sa inlocuiesti CarInfo cu variabilele pe care le folosesti tu la tine in gamemode.

  12. 1 oră în urmă, Razvan Balan a spus:

    De curand mi-am descarcat un gamemode de pe net, insa am gasit un bug legat de comanda /rac. Apare in chat All unused cars will be respawned in 10 seconds by admin x sau ceva de genul si le da un fel de refresh(dispar si apar) ca si cum ai dat /park de iti spawneaza masina unde ai park. Cum fac sa se respawneze masinile nefolosite?Ca vreau usor usor sa modific gamemode-ul acesta si sa adaug alte comenzi si chestii usor, usor. PRECIZEZ ca sunt la inceput si de abia ieri am inceput sa folosesc pawno, cu mici tutoriale.

     CMD:rac(playerid, params[])
    {
            if(IsPlayerConnected(playerid))
            {
                if(PlayerInfo[playerid][pAdmin] < 3)
                {
                    SendClientMessage(playerid, COLOR_ERROR, AdminOnly);
                    return 1;
                }
                new string[256], sendername[30];
                SetTimer("RACtime", 10000, 0);
                GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string,sizeof(string),"{FFFFFF}All unused cars will be respawned in {009999}10 {FFFFFF}seconds by %s!", sendername);
                SendClientMessageToAll(COLOR_WHITE,string);
            }
            return 1;

    CMD:rac(playerid, params[])
    {
            if(IsPlayerConnected(playerid))
            {
                if(PlayerInfo[playerid][pAdmin] < 3)
                {
                    SendClientMessage(playerid, COLOR_ERROR, AdminOnly);
                    return 1;
                }
                new string[256], sendername[30];
                SetTimer("RACtime", 10000, 0);
                GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string,sizeof(string),"{FFFFFF}All unused cars will be respawned in {009999}10 {FFFFFF}seconds by %s!", sendername);
                SendClientMessageToAll(COLOR_WHITE,string);
            }
            return 1;


     

    function RACtime()
    {
    	for(new vid = 0, j = GetVehiclePoolSize(); vid < j; vid++)
    	{
    		if(CarInfo[vid][cOwned] == 0 && !IsVehicleInUse(vid))
                SetVehicleToRespawn(vid);
    	}
    	return 1;
    }

     

  13. Deci... Daca nu ma insel in loc de pInfo[playerid][pName] ar trebui sa folosesti PlayerInfo[playerid][pName], astfel:

    GetPlayerName(playerid, PlayerInfo[playerid][pName], MAX_PLAYER_NAME); 

    Tu ai enumerate niste variable in arrayul pInfo, iar variabila PlayerInfo le foloseste pe cele din pInfo. Sper ca ai inteles.

  14. Acum 2 ore, Alexandru Solomon a spus:

    Salut,

    de curand am inceput un "sistem" de vara.

    Cu o comanda ce-ti permite un bonus.

    "summerbonus"

    Oricum, ceea ce nu inteleg, este ca:

    1. Am un tabel in 'users' numit 'SummerBonus' in care daca ai valoarea 1, nu mai poti folosi comanda.

    2. Nu am gasit niciun tutorial explicativ cum sa folosesti mysql.

    Comanda mea arata pana cum asa:

    https://pastebin.com/Lis1tyNM

     

    • format(string,sizeof(string),"UPDATE `users` SET `SummerBonus` = '1 WHERE `name` = '%s'",PlayerName);
    • mysql_query(string);
    if(PlayerInfo[playerid][pSummerBonus] == 1) return SCM(playerid, -1, "Acest bonus poate fii folosit o singura data!"); // aici verifica daca summerbonus este = cu 1. Probabil ca sa interzici vrei sa pui 0. Asa ca pur si simplu inlocuiesti treaba. Pui 0 in loc de 1.
    Si in comanda adauga la final:
    PlayerInfo[playerid][pSummerBonus] = 0;
  15. Acum 25 minute, LoLzoR a spus:

    Inco problema, casa vezi, o mers , bun am vazut ca nu o mers sa ma conetez, asa, am bagat iar data de baza, casa vezi i-am dat Restart, server Offline..........

    Posteaza server_log aici. Sau mai bine fa un fisier pawn.cfg, scrie in el -d3 compileaza gm si porneste serverul, apoi posteaza server_log.

×
×
  • 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.