SA-MP Forums Archive
How to change /buylevel a /levelup - 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)
+--- Thread: How to change /buylevel a /levelup (/showthread.php?tid=418205)



/levelup eror,help me - AlbertWeSkeR - 24.02.2013

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.



Re: How to change /buylevel a /levelup - KeenanRitchie - 24.02.2013

which line is 32048?


Re: How to change /buylevel a /levelup - AlbertWeSkeR - 24.02.2013

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



Re: How to change /buylevel a /levelup - @Riichard - 24.02.2013

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;
}



Re: How to change /buylevel a /levelup - AlbertWeSkeR - 24.02.2013

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


Re: How to change /buylevel a /levelup - AlbertWeSkeR - 24.02.2013

Please Help mee!!


Re: How to change /buylevel a /levelup - AlbertWeSkeR - 24.02.2013

Help mee UP UP


Re: How to change /buylevel a /levelup - PabloDiCostanzo - 24.02.2013

Be patient, I'll see what can I do.


Re: How to change /buylevel a /levelup - Yves - 24.02.2013

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


Re: How to change /buylevel a /levelup - AlbertWeSkeR - 25.02.2013

continue to do? is removed?