[Pomoc] /levelup komanda

Započeo vlado_plavsic, Avgust 21, 2011, 15:27:24 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

vlado_plavsic

Skripta koju koristim: GF edit
Detaljan opis problema: Kad skupim na primer 8/8 respekta za 2. level i ukucam /levelup,Popne me na 2. lvl al mi sad ostane 8/12 respekta.Kako da namestim da mi stavi na 0/12? Lupam glavu ceo dan ne mogu da napravim :S
Dio skripte:

if (strcmp(cmd, "/levelup", true) == 0)
{
   if(IsPlayerConnected(playerid))
   {
if (gPlayerLogged[playerid] != 0)
{
if(PlayerInfo[playerid][pLevel] >= 0)
{
new nxtlevel = PlayerInfo[playerid][pLevel]+1;
new expamount = nxtlevel*levelexp;
new infostring[128];
if (PlayerInfo[playerid][pExp] < expamount)
{
format(infostring, 256, "Treba vam %d Respecta, Trenutno imate [%d] !",expamount,PlayerInfo[playerid][pExp]);
SendClientMessage(playerid, COLOR_GRAD1, infostring);
return 1;
}
else
{
format(string, sizeof(string), "~g~LEVEL UP~n~~w~Sada ste Level %d", nxtlevel);
PlayerInfo[playerid][pLevel]++;
GameTextForPlayer(playerid, string, 5000, 1);
      SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /levelup (%d)",d,m,y,h,mi,s,sendername,nxtlevel);
}
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "   You are not Logged in !");
}
}
return 1;
}

dragan12

Probaj ovako fali ti da ti oduzme exp od kolicine koja je potrebna.
if (strcmp(cmd, "/levelup", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
if (gPlayerLogged[playerid] != 0)
{
if(PlayerInfo[playerid][pLevel] >= 0)
{
new nxtlevel = PlayerInfo[playerid][pLevel]+1;
new expamount = nxtlevel*levelexp;
new infostring[128];
if (PlayerInfo[playerid][pExp] < expamount)
{
format(infostring, 256, "Treba vam %d Respecta, Trenutno imate [%d] !",expamount,PlayerInfo[playerid][pExp]);
SendClientMessage(playerid, COLOR_GRAD1, infostring);
return 1;
}
else
{
format(string, sizeof(string), "~g~LEVEL UP~n~~w~Sada ste Level %d", nxtlevel);
PlayerInfo[playerid][pLevel]++;
GameTextForPlayer(playerid, string, 5000, 1);
                                            PlayerInfo[playerid][pExp] -= expamount;
        SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /levelup (%d)",d,m,y,h,mi,s,sendername,nxtlevel);
}
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "   You are not Logged in !");
}
}
return 1;
}

vlado_plavsic