public OnPlayerUpdate(playerid) { new string[256]; SetPlayerScore(playerid, GetPlayerLevel(playerid)); if(GetPlayerExp(playerid) >= maxexplvl) { GivePlayerLevel(playerid, 1); format(string, sizeof(string), "* Congratulations! Your char id had ben increased level to {FFFFFF}-> %d", GetPlayerLevel(playerid)); SendClientMessage(playerid, 0xCCFF00BB, string); GivePlayerExp(playerid, - 1000); } return 1; }
stock maxexplvl(playerid) { if(GetPlayerLevel(playerid, 1) return maxexplvl(1000) }
stock maxexplvl(playerid)
{
switch(GetPlayerLevel(playerid))
{
case 0://Player level is 0
case 1://Player level is 1
case 2://And so on
}
return 1;
}
pawn Код:
|
stock maxexplvl(playerid)
{
if(GetPlayerLevel(playerid, 1) return 1000;
return 1;
}
He still can do if statement.
pawn Код:
|
C:\blabla.pwn(1460) : error 076: syntax error in the expression, or invalid function call Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.
stock maxexplvl(playerid)
{
switch(GetPlayerLevel(playerid))
{
case 1: return 1000;//Kalo Level player 1, max level jadi 1000
case 2: return 2000;//Kalo Level player 2, max level jadi 2000
}
return 1;
}
public OnPlayerUpdate(playerid)
{
new string[256];
SetPlayerScore(playerid, GetPlayerLevel(playerid));
if(GetPlayerExp(playerid) >= maxexplvl(playerid))//Pake playerid soalnya di stock agan butuh 1 argument
{
GivePlayerLevel(playerid, 1);
format(string, sizeof(string), "* Congratulations! Your char id had ben increased level to {FFFFFF}-> %d", GetPlayerLevel(playerid));
SendClientMessage(playerid, 0xCCFF00BB, string);
GivePlayerExp(playerid, - 1000);
}
return 1;
}