RespectPoints - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: RespectPoints (
/showthread.php?tid=270679)
RespectPoints -
Dark_Yenibu - 21.07.2011
Hy , I have a problem at my GodFather server , that problem it's at respectpoints. If somebody has 10/8 respectpoints and it writes /buylevel that 2 respectpoints that remains it not apairs... what i need to do? Please Help ...
Thanks !
Re: RespectPoints -
RSX - 21.07.2011
Expand your problem, as far as I can tell the script is loosing 2 or all respect points that are over the needed value, possibly it would help if you would post : respectpoints definition/declaration and /buylevel command.
Re: RespectPoints -
Dark_Yenibu - 21.07.2011
Код:
//-------------------------------[BuyLevel]--------------------------------------------------------------------------
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[256];
if(GetPlayerMoney(playerid) < costlevel)
{
format(infostring, 256, " You do not have enough Cash ($%d) !",costlevel);
SendClientMessage(playerid, COLOR_GRAD1, infostring);
return 1;
}
else if (PlayerInfo[playerid][pExp] < expamount)
{
format(infostring, 256, " 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] = 0;
}
}
else
{
PlayerInfo[playerid][pExp] = 0;
}
PlayerInfo[playerid][gPupgrade] = PlayerInfo[playerid][gPupgrade]+2;
GameTextForPlayer(playerid, string, 5000, 1);
format(infostring, 256, " You bought Level %d for ($%d) Type /upgrade", nxtlevel, costlevel);
SendClientMessage(playerid, COLOR_GRAD1, infostring);
format(infostring, 256, " 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;
}
i have this cmd ... at /buylevel
Re: RespectPoints -
RSX - 21.07.2011
I'm not sure if there's anything wrong with it actually, maybe there's a problem elsewhere.
Please write a full clear report on when something appears to be wrong with /buylevel
Re: RespectPoints -
Dark_Yenibu - 21.07.2011
okey.... but can you help me here... ?
http://forum.sa-mp.com/showthread.ph...=1#post1303545