Jump to content

Question

Posted

Buna ziua , sunt la inceput la scripting 

Am o erroare : C:\Users\George\Desktop\JustGame Server\gamemodes\JG.pwn(20989) : warning 219: local variable "gString" shadows a variable at a preceding level
C:\Users\George\Desktop\JustGame Server\gamemodes\JG.pwn(20999) : error 017: undefined symbol "pExp"
C:\Users\George\Desktop\JustGame Server\gamemodes\JG.pwn(20990) : warning 204: symbol is assigned a value that is never used: "szMessage"

 

Folosesc GM JustGame si am adaugat comanda get gift , am facut tot ca in tutorial 

Dar intampin probleme la : 

CMD:getgift(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first."); // Verifica daca-i logat
    if(PlayerInfo[playerid][pGift] == 0) return SendClientMessage(playerid, COLOR_WHITE, "Ai nevoie de minim 1 Gift Point pentru a putea folosi comanda."); // Iii trimite un mesaj daca nu are giftpoints

    new gString[512];
    new szMessage[256];//s-ar putea sa nu ai voie daca nu ai si SCM
    switch(random(2)) // Aici e facut sa iti deie randem din cele 2 case-uri tu poti adauga case 3 case 4 etc.. si pentru fiecare case nou modifici in switch(random(3)) switch(random(4))  sau cate ai.
     {
        case 0:
        {
            new rp = 5;// Aici poti baga sa-i adauge cat rp vrei tu eu am pus 5
            SendClientMessage(playerid, COLOR_WHITE, "Ai castigat 5 Respect Points de la giftbox.");// castiga 5 Respect points
            PlayerInfo[playerid][pGift] -= 1;
            Update(playerid, pGiftx);
            PlayerInfo[playerid][pExp] += rp;
            Update(playerid, pRP);
            GameTextForPlayer(playerid, "~g~5 Respect Points!", 5000, 1);
        }
        case 1:
        {
            new cash = 100000 + random(200000); // Castiga o suma de bani 100.000 $ + random din suma de 200.000 $
            format(gString,sizeof(gString),"* You received $%s.",FormatNumber(cash)); // aici il scrie
            SendClientMessage(playerid, COLOR_SYN, gString);//aici afiseaza mesajul
            PlayerInfo[playerid][pGift] -= 1;
            Update(playerid, pGiftx);
            GivePlayerCash(playerid, cash);
            GameTextForPlayer(playerid, "~g~100.000 - 300.000$!", 5000, 1);
        }

    }
    return 1;

7 answers to this question

Recommended Posts

  • 1
Posted

 

Am o erroare : C:\Users\George\Desktop\JustGame Server\gamemodes\JG.pwn(20989) : warning 219: local variable "gString" shadows a variable at a preceding level
C:\Users\George\Desktop\JustGame Server\gamemodes\JG.pwn(20999) : error 017: undefined symbol "pExp"
C:\Users\George\Desktop\JustGame Server\gamemodes\JG.pwn(20990) : warning 204: symbol is assigned a value that is never used: "szMessage"

 

Prima - ai creat de 2 ori new gString. rand 20999 apasa ctrl + g in pawn editor.

A doua - Ai folosit pExp fara sa il fi definit/creat inainte.

A treia - szMessage nu e folosit nicaieri , e recomandat sa-l stergi.

  • 1
Posted

Nu ai pExp in gamemode, modifica cu ce ai tu in gamemode

11 minutes ago, Unique said:

C:\Users\George\Desktop\JustGame Server\gamemodes\JG.pwn(20990) : warning 219: local variable "gString" shadows a variable at a preceding level
C:\Users\George\Desktop\JustGame Server\gamemodes\JG.pwn(20999) : error 017: undefined symbol "pExp"
C:\Users\George\Desktop\JustGame Server\gamemodes\JG.pwn(21006) : error 035: argument type mismatch (argument 1)
C:\Users\George\Desktop\JustGame Server\gamemodes\JG.pwn(21006) : error 035: argument type mismatch (argument 1)
C:\Users\George\Desktop\JustGame Server\gamemodes\JG.pwn(21007) : error 035: argument type mismatch (argument 3)
C:\Users\George\Desktop\JustGame Server\gamemodes\JG.pwn(20990) : warning 203: symbol is never used: "gString"

acum imi da asta

 

  • 1
Posted

Nu am cu sa iti spun, nu am intrat in .pwn-ul gamemode-ului justgame.Poti cauta si singur, sau intreaba pe cineva care are gm-ul

  • 0
Posted

C:\Users\George\Desktop\JustGame Server\gamemodes\JG.pwn(20990) : warning 219: local variable "gString" shadows a variable at a preceding level
C:\Users\George\Desktop\JustGame Server\gamemodes\JG.pwn(20999) : error 017: undefined symbol "pExp"
C:\Users\George\Desktop\JustGame Server\gamemodes\JG.pwn(21006) : error 035: argument type mismatch (argument 1)
C:\Users\George\Desktop\JustGame Server\gamemodes\JG.pwn(21006) : error 035: argument type mismatch (argument 1)
C:\Users\George\Desktop\JustGame Server\gamemodes\JG.pwn(21007) : error 035: argument type mismatch (argument 3)
C:\Users\George\Desktop\JustGame Server\gamemodes\JG.pwn(20990) : warning 203: symbol is never used: "gString"

acum imi da asta

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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.