07.01.2016, 10:31
I want to keep /levelup without paying cash, Can you help me with this:
lines:
Код:
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.
PHP код:
CMD:levelup(playerid, params[])
{
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(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;
}
else if
{
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);
//GivePlayerCash(playerid, (-costlevel));
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), "You have leveled up!, and gained %i upgrade points! /upgrade to use them.", nxtlevel, costlevel, 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;
}