Need help
#1

Hello can someone show me the code how to fix the stock [maxexplvl]

Код:
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;
}
maxexplvl function is when it (getplayerlevel, 1) the value of maxexplvl is 1000 then if (getplayerlevel, 2) the value of maxexplvl is 2000 can you guys help me to create the callback code?

i don't know how.. are it look like this?
Код:
stock maxexplvl(playerid)
{
	if(GetPlayerLevel(playerid, 1) return maxexplvl(1000)
}
Reply
#2

pawn Код:
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;
}
Reply
#3

Quote:
Originally Posted by varthshenon
Посмотреть сообщение
pawn Код:
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;
}
He still can do if statement.
pawn Код:
stock maxexplvl(playerid)
{
    if(GetPlayerLevel(playerid, 1) return 1000;
        return 1;
}
Reply
#4

Im confused here..
Reply
#5

Quote:
Originally Posted by FireCat
Посмотреть сообщение
He still can do if statement.
pawn Код:
stock maxexplvl(playerid)
{
    if(GetPlayerLevel(playerid, 1) return 1000;
        return 1;
}
But switch is faster.
Reply
#6

Quote:
Originally Posted by leingod
Посмотреть сообщение
Im confused here..
Try using both.
But mine is already "made" with 1000.
Just copy and paste for the level you want like
if(GetPlayerLevel(playerid,2)) return 2000;
Reply
#7

Код:
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.
Reply
#8

Kalo mau lebih cepet pake switch gan, kalo bingung caranya tanya aja. Namanya juga tempat diskusi.
Reply
#9

Pasang value 1000 nya dmn? kalo pake switch
Reply
#10

pawn Код:
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;
}
Di OPU agan, maxexplv nya salah.
pawn Код:
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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)