Jump to content
  • 0

Erroare get gift


Unique

Question

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;

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 1

 

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.

Link to comment
Share on other sites

  • 1

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

 

Link to comment
Share on other sites

  • 0

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

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
Answer this question...

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