How to change /buylevel a /levelup
#1

Command /buylevel it right when in use to raise the level it should pay
nah I want to change that to /levelup and do not pay, what you guys here have his command? help me
I need it all.

I have a command levelup but BUG.,

Код:
CMD:levelup(playerid, params[])
{
	if (gPlayerLogged{playerid} != 0)
	{
		if(PlayerInfo[playerid][pLevel] >= 0)
		{
			new nxtlevel = PlayerInfo[playerid][pLevel]+1;
			new expamount = nxtlevel*levelexp;

			{
				new string[58];
				format(string, sizeof(string), "You need %d more respect points to buy your next level.", expamount - PlayerInfo[playerid][pExp]);
				SendClientMessageEx(playerid, COLOR_GRAD1, string);
				return 1;
			}
				new string[92];
				format(string, sizeof(string), "~g~LEVEL UP~n~~w~You Are Now Level %d", nxtlevel);
				PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
				PlayerInfo[playerid][pLevel]++;
				PlayerInfo[playerid][pExp] = PlayerInfo[playerid][pExp]-expamount;
				PlayerInfo[playerid][gPupgrade] = PlayerInfo[playerid][gPupgrade]+2;
				GameTextForPlayer(playerid, string, 5000, 1);
				format(string, sizeof(string), "Kamu telah naik level %s, dan mendapatkan upgrade point sebanyak %i /upgrade untuk memakainya", nxtlevel, PlayerInfo[playerid][gPupgrade]);
				SendClientMessageEx(playerid, COLOR_GRAD1, string);
				SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
				if(PlayerInfo[playerid][pLevel] == 6)
				{
				    SendClientMessageEx(playerid, COLOR_GRAD1, "Newbie chat will now be automatically togged off on login.");
				}
			}
		}
		return 1;
	}
Код:
C:\Users\pc7\Downloads\Respect 1\gamemodes\RCRP.pwn(32048) : warning 225: unreachable code
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Reply
#2

which line is 32048?
Reply
#3

This line 32048
Код:
new string[92];
Reply
#4

Test...

pawn Код:
CMD:levelup(playerid) {
    if (gPlayerLogged[playerid] != 0) {
        if (PlayerInfo[playerid][pLevel] >= 0) {
            new
                nxtlevel = PlayerInfo[playerid][pLevel]+1,
                expamount = nxtlevel*levelexp,
                string[120]
            ;
            format(string, sizeof(string), "You need %d more respect points to buy your next level.", expamount - PlayerInfo[playerid][pExp]);
            SendClientMessageEx(playerid, COLOR_GRAD1, string);
            format(string, sizeof(string), "~g~LEVEL UP~n~~w~You Are Now Level %d", nxtlevel);
            GameTextForPlayer(playerid, string, 5000, 1);
            PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
            PlayerInfo[playerid][pLevel]++;
            PlayerInfo[playerid][pExp] = PlayerInfo[playerid][pExp]-expamount;
            PlayerInfo[playerid][gPupgrade] = PlayerInfo[playerid][gPupgrade]+2;
            format(string, sizeof(string), "Kamu telah naik level %s, dan mendapatkan upgrade point sebanyak %i /upgrade untuk memakainya", nxtlevel, PlayerInfo[playerid][gPupgrade]);
            SendClientMessageEx(playerid, COLOR_GRAD1, string);
            SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
            if(PlayerInfo[playerid][pLevel] == 6)
                return SendClientMessageEx(playerid, COLOR_GRAD1, "Newbie chat will now be automatically togged off on login.");
        }
    }
    return 1;
}
Reply
#5

Quote:
Originally Posted by @Riichard
Посмотреть сообщение
Test...

pawn Код:
CMD:levelup(playerid) {
    if (gPlayerLogged[playerid] != 0) {
        if (PlayerInfo[playerid][pLevel] >= 0) {
            new
                nxtlevel = PlayerInfo[playerid][pLevel]+1,
                expamount = nxtlevel*levelexp,
                string[120]
            ;
            format(string, sizeof(string), "You need %d more respect points to buy your next level.", expamount - PlayerInfo[playerid][pExp]);
            SendClientMessageEx(playerid, COLOR_GRAD1, string);
            format(string, sizeof(string), "~g~LEVEL UP~n~~w~You Are Now Level %d", nxtlevel);
            GameTextForPlayer(playerid, string, 5000, 1);
            PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
            PlayerInfo[playerid][pLevel]++;
            PlayerInfo[playerid][pExp] = PlayerInfo[playerid][pExp]-expamount;
            PlayerInfo[playerid][gPupgrade] = PlayerInfo[playerid][gPupgrade]+2;
            format(string, sizeof(string), "Kamu telah naik level %s, dan mendapatkan upgrade point sebanyak %i /upgrade untuk memakainya", nxtlevel, PlayerInfo[playerid][gPupgrade]);
            SendClientMessageEx(playerid, COLOR_GRAD1, string);
            SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
            if(PlayerInfo[playerid][pLevel] == 6)
                return SendClientMessageEx(playerid, COLOR_GRAD1, "Newbie chat will now be automatically togged off on login.");
        }
    }
    return 1;
}
There is no error, but when in the game /levelup could go on, do not use respect points
Reply
#6

Please Help mee!!
Reply
#7

Help mee UP UP
Reply
#8

Be patient, I'll see what can I do.
Reply
#9

you have a unreachable code make sure you go to line 32048 and make sure the } is close to reachable
Reply
#10

continue to do? is removed?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)