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);
}
Question
Unique
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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.