2 problems
#1

1.ok so i buy level and i have 30/10 respect ok?i do /buylevel and the respect gets at 0.. it needs to be 20/10..
2.my radar problem is that i get caught twice at same radar..anytime its not the lag..

please help this means to much to me!!
Reply
#2

Please wait while I guess your code.
Reply
#3

what part code you need.
Reply
#4

how can we help you without explaining your problem clearly.
and not even codes?

please explain more and provide codes.
Reply
#5

PHP код:
if (strcmp(cmd"/buylevel"true) == 0)
                    {
                    if(
IsPlayerConnected(playerid))
                    {
                    if (
gPlayerLogged[playerid] != 0)
                    {
                        
PlayerInfo[playerid][pCash] = GetPlayerCash(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(
GetPlayerCash(playerid) < costlevel)
                            {
                                
format(infostring256"   You do not have enough Cash (%dLei) !",costlevel);
                                
SendClientMessage(playeridCOLOR_GRAD1infostring);
                                return 
1;
                            }
                            else if (
PlayerInfo[playerid][pExp] < expamount)
                            {
                                
format(infostring256"   You need %d Respect Points, you curently have [%d] !",expamount,PlayerInfo[playerid][pExp]);
                                
SendClientMessage(playeridCOLOR_GRAD1infostring);
                                return 
1;
                            }
                            else
                            {
                                
format(stringsizeof(string), "~g~LEVEL UP~n~~w~You Are Now Level %d"nxtlevel);
                                
PlayerPlaySound(playerid10520.00.00.0);
                                
PlayerPlayMusic(playerid);
                                
GivePlayerCash(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(playeridstring50001);
                                
format(infostring256"   You bought Level %d for (%dLei) Type /upgrade"nxtlevelcostlevel);
                                
SendClientMessage(playeridCOLOR_GRAD1infostring);
                                
format(infostring256"   You gave %d unspent Upgrade Points",PlayerInfo[playerid][gPupgrade]);
                                
SendClientMessage(playeridCOLOR_GRAD2infostring);
                            }
                        }
                        return 
1;
                    }
                    else
                    {
                        
SendClientMessage(playeridCOLOR_GRAD1"   You are not Logged in !");
                    }
                    }
                    return 
1;
                    } 
i have respect 10 and maxim is 5 ok?(10/5) i buy level and the respect points gets to be 0 ..
Reply
#6

anyone help??
Reply
#7

anyone help??i buy a level and then the respect points go to 0 ..
Reply
#8

try this
pawn Код:
if (strcmp(cmd, "/buylevel", true) == 0)
                    {
                    if(IsPlayerConnected(playerid))
                    {
                    if (gPlayerLogged[playerid] != 0)
                    {
                        PlayerInfo[playerid][pCash] = GetPlayerCash(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(GetPlayerCash(playerid) < costlevel)
                            {
                                format(infostring, 256, "   You do not have enough Cash (%dLei) !",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);
                                GivePlayerCash(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;
                                    }
                                }
                                PlayerInfo[playerid][gPupgrade] = PlayerInfo[playerid][gPupgrade]+2;
                                GameTextForPlayer(playerid, string, 5000, 1);
                                format(infostring, 256, "   You bought Level %d for (%dLei) 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;
                    }
Reply
#9

Quote:
Originally Posted by HuSs3n
Посмотреть сообщение
try this
pawn Код:
if (strcmp(cmd, "/buylevel", true) == 0)
                    {
                    if(IsPlayerConnected(playerid))
                    {
                    if (gPlayerLogged[playerid] != 0)
                    {
                        PlayerInfo[playerid][pCash] = GetPlayerCash(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(GetPlayerCash(playerid) < costlevel)
                            {
                                format(infostring, 256, "   You do not have enough Cash (%dLei) !",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);
                                GivePlayerCash(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;
                                    }
                                }
                                PlayerInfo[playerid][gPupgrade] = PlayerInfo[playerid][gPupgrade]+2;
                                GameTextForPlayer(playerid, string, 5000, 1);
                                format(infostring, 256, "   You bought Level %d for (%dLei) 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;
                    }
the respect points need so look i have 13/12 respect..i buy level and its [1/(next level Respect)]
Reply
#10

Well I Hope This Will Help You...
1st Error;
PHP код:
CMD:buylevel(playeridparams[])
{
    if (
gPlayerLogged{playerid} != 0)
    {
        if(
PlayerInfo[playerid][pLevel] >= 0)
        {
            new 
nxtlevel PlayerInfo[playerid][pLevel]+1;
            new 
costlevel nxtlevel*levelcost;
            new 
expamount nxtlevel*levelexp;

            if(
GetPlayerCash(playerid) < costlevel)
            {
                new 
string[128];
                
format(stringsizeof(string), "You don't have enough cash ($%d).",costlevel);
                
SendClientMessageEx(playeridCOLOR_GRAD1string);
                return 
1;
            }
            else if (
PlayerInfo[playerid][pExp] < expamount)
            {
                new 
string[58];
                
format(stringsizeof(string), "You need %d more respect points to buy your next level."expamount PlayerInfo[playerid][pExp]);
                
SendClientMessageEx(playeridCOLOR_GRAD1string);
                return 
1;
            }
            else
            {
                new 
string[92];
                
format(stringsizeof(string), "~g~LEVEL UP~n~~w~You Are Now Level %d"nxtlevel);
                
PlayerPlaySound(playerid10520.00.00.0);
                
GivePlayerCash(playerid, (-costlevel));
                
PlayerInfo[playerid][pLevel]++;
                
PlayerInfo[playerid][pExp] = PlayerInfo[playerid][pExp]-expamount;
                
PlayerInfo[playerid][gPupgrade] = PlayerInfo[playerid][gPupgrade]+2;
                
GameTextForPlayer(playeridstring50001);
                
format(stringsizeof(string), "You have bought level %d for $%d, and gained %i upgrade points! /upgrade to use them."nxtlevelcostlevelPlayerInfo[playerid][gPupgrade]);
                
SendClientMessageEx(playeridCOLOR_GRAD1string);
                
SetPlayerScore(playeridPlayerInfo[playerid][pLevel]);
                if(
PlayerInfo[playerid][pLevel] == 6)
                {
                    
SendClientMessageEx(playeridCOLOR_GRAD1"Newbie chat will now be automatically togged off on login.");
                }
            }
        }
        return 
1;
    }
    else
    {
        
SendClientMessageEx(playeridCOLOR_GRAD1"You're not logged in.");
    }
    return 
1;

2nd One I Dont Know What Are You Saying..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)