#1

I want to keep /levelup without paying cash, Can you help me with this:
Код:
E:\Official Server\gamemodes\ggrpv1a.pwn(43424) : warning 225: unreachable code
E:\Official Server\gamemodes\ggrpv1a.pwn(43424) : error 029: invalid expression, assumed zero
E:\Official Server\gamemodes\ggrpv1a.pwn(43424) : warning 215: expression has no effect
E:\Official Server\gamemodes\ggrpv1a.pwn(43424) : error 001: expected token: ";", but found "if"
E:\Official Server\gamemodes\ggrpv1a.pwn(43426) : error 029: invalid expression, assumed zero
E:\Official Server\gamemodes\ggrpv1a.pwn(43426) : warning 215: expression has no effect
E:\Official Server\gamemodes\ggrpv1a.pwn(43426) : error 001: expected token: ";", but found "]"
E:\Official Server\gamemodes\ggrpv1a.pwn(43426) : error 029: invalid expression, assumed zero
E:\Official Server\gamemodes\ggrpv1a.pwn(43426) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.
lines:
PHP код:
CMD:levelup(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(string, sizeof(string), "You don't have enough cash ($%d).",costlevel);
                SendClientMessageEx(playerid, COLOR_GRAD1, string);
                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 if
            {
                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 leveled up!, 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;
    } 
Reply
#2

Try,
PHP код:
CMD:levelup(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(string, sizeof(string), "You don't have enough cash ($%d).",costlevel); 
                SendClientMessageEx(playerid, COLOR_GRAD1, string); 
                return 1; 
            } */
             
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 leveled up!, 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
    } 
Reply
#3

Show the errors Line
Reply
#4

Thank you it works., +rep
Reply
#5

**BUMP**
Reply
#6

Its Good your Command is now working.. have a nice day and feel free to ask again anything if you have doubt.. xD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)