07.01.2016, 06:48
Errors:
D:\Adv-Gaming\SampSvr (RP)\Script\gamemodes\roleplay.pwn(38001) : warning 209: function "cmd_buylevel" should return a value
D:\Adv-Gaming\SampSvr (RP)\Script\gamemodes\roleplay.pwn(38002) : error 054: unmatched closing brace ("}")
D:\Adv-Gaming\SampSvr (RP)\Script\gamemodes\roleplay.pwn(38003) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Errors.
My /buylevel cmd:
CMD:buylevel(playerid, params[])
{
//if (gPlayerLogged{playerid} != 0)
//{
//if(PlayerData[playerid][pLevel] >= 0)
//{
new nxtlevel = PlayerData[playerid][pLevel]+1;
new costlevel = nxtlevel*levelcost;
new playinghoursamount = nxtlevel*levelplayinghours;
//if (GetMoney(playerid) < 500)
if(GetMoney(playerid) < costlevel)
{
new string[128];
format(string, sizeof(string), "You don't have enough cash ($%d).",costlevel);
SendClientMessageEx(playerid, COLOR_WHITE, string);
return 1;
}
else if (PlayerData[playerid][pPlayingHours] < playinghoursamount)
{
new string[58];
format(string, sizeof(string), "You need %d more respect points to buy your next level.", playinghoursamount - PlayerData[playerid][pPlayingHours]);
SendClientMessageEx(playerid, COLOR_WHITE, string);
return 1;
}
else
{
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);
GiveMoney(playerid, (-costlevel));
PlayerData[playerid][pLevel]++;
PlayerData[playerid][pPlayingHours] = PlayerData[playerid][pPlayingHours]-playinghoursamount;
//PlayerData[playerid][gPupgrade] = PlayerData[playerid][gPupgrade]+2;
GameTextForPlayer(playerid, string, 5000, 1);
format(string, sizeof(string), "You have bought level %d for $%d", nxtlevel, costlevel);
SendClientMessageEx(playerid, COLOR_WHITE, string);
SetPlayerScore(playerid, PlayerData[playerid][pLevel]);
}
}
}
return 1;
}
D:\Adv-Gaming\SampSvr (RP)\Script\gamemodes\roleplay.pwn(38001) : warning 209: function "cmd_buylevel" should return a value
D:\Adv-Gaming\SampSvr (RP)\Script\gamemodes\roleplay.pwn(38002) : error 054: unmatched closing brace ("}")
D:\Adv-Gaming\SampSvr (RP)\Script\gamemodes\roleplay.pwn(38003) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Errors.
My /buylevel cmd:
CMD:buylevel(playerid, params[])
{
//if (gPlayerLogged{playerid} != 0)
//{
//if(PlayerData[playerid][pLevel] >= 0)
//{
new nxtlevel = PlayerData[playerid][pLevel]+1;
new costlevel = nxtlevel*levelcost;
new playinghoursamount = nxtlevel*levelplayinghours;
//if (GetMoney(playerid) < 500)
if(GetMoney(playerid) < costlevel)
{
new string[128];
format(string, sizeof(string), "You don't have enough cash ($%d).",costlevel);
SendClientMessageEx(playerid, COLOR_WHITE, string);
return 1;
}
else if (PlayerData[playerid][pPlayingHours] < playinghoursamount)
{
new string[58];
format(string, sizeof(string), "You need %d more respect points to buy your next level.", playinghoursamount - PlayerData[playerid][pPlayingHours]);
SendClientMessageEx(playerid, COLOR_WHITE, string);
return 1;
}
else
{
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);
GiveMoney(playerid, (-costlevel));
PlayerData[playerid][pLevel]++;
PlayerData[playerid][pPlayingHours] = PlayerData[playerid][pPlayingHours]-playinghoursamount;
//PlayerData[playerid][gPupgrade] = PlayerData[playerid][gPupgrade]+2;
GameTextForPlayer(playerid, string, 5000, 1);
format(string, sizeof(string), "You have bought level %d for $%d", nxtlevel, costlevel);
SendClientMessageEx(playerid, COLOR_WHITE, string);
SetPlayerScore(playerid, PlayerData[playerid][pLevel]);
}
}
}
return 1;
}