- 0
Problema Respect Points
-
Similar Content
-
Recently Browsing 0 members
- No registered users viewing this page.
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.
Question
Twes
Nick: Twes
Problema: In momentul in care cineva da /buylevel RP care a fost necesar pentru level se pune cu "-" :
De exemplu : Pentru level 3 ai nevoie de 12 RP , ai 12/12 RP dai /buylevel iar apoi in stats apare : -12/16
Erori / warnings: -
Lini/script: de la /buylevel
[pawn] if (strcmp(cmd, "/buylevel", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (gPlayerLogged[playerid] != 0)
{
PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
if(PlayerInfo[playerid][pLevel] >= 0)
{
new nxtlevel = PlayerInfo[playerid][pLevel]+1;
new costlevel = nxtlevel*levelcost;//10k for testing purposes
new expamount = nxtlevel*levelexp;
new infostring[128];//era 256
if(GetPlayerMoney(playerid) < costlevel)
{
format(infostring, 128, " You do not have enough Cash ($%d) !",costlevel);
SendClientMessage(playerid, COLOR_GRAD1, infostring);
return 1;
}
else if (PlayerInfo[playerid][pExp] < expamount)
{
format(infostring, 128, " You need %d Respect Points, you curently have [%d] !",expamount,PlayerInfo[playerid][pExp]);
SendClientMessage(playerid, COLOR_GRAD1, infostring);
return 1;
}
else
{
format(string, sizeof(string), "~g~LEVEL UP~n~~w~You Are Now Level %d", nxtlevel);
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
PlayerPlayMusic(playerid);
GivePlayerMoney(playerid, (-costlevel));
PlayerInfo[playerid][pLevel]++;
if(PlayerInfo[playerid][pDonateRank] > 0)
{
PlayerInfo[playerid][pExp] -= expamount;
new total = PlayerInfo[playerid][pExp];
if(total > 0)
{
PlayerInfo[playerid][pExp] = total;
}
else
{
PlayerInfo[playerid][pExp] -= expamount;
}
}
else
{
PlayerInfo[playerid][pExp] -= expamount;
}
PlayerInfo[playerid][gPupgrade] = PlayerInfo[playerid][gPupgrade]+2;
GameTextForPlayer(playerid, string, 5000, 1);
format(infostring, 128, " You bought Level %d for ($%d) Type /upgrade", nxtlevel, costlevel);
SendClientMessage(playerid, COLOR_GRAD1, infostring);
format(infostring, 128, " You gave %d unspent Upgrade Points",PlayerInfo[playerid][gPupgrade]);
SendClientMessage(playerid, COLOR_GRAD2, infostring);
}
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not Logged in !");
}
}
return 1;
}[/pawn]
Ai incercat sa rezolvi singur ?: Da
2 answers to this question
Recommended Posts