PDA

View Full Version : Need help


leingod
01/09/2011, 07:15 AM
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)
}

=WoR=Varth
01/09/2011, 07:20 AM
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;
}

FireCat
01/09/2011, 07:23 AM
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.

stock maxexplvl(playerid)
{
if(GetPlayerLevel(playerid, 1) return 1000;
return 1;
}

leingod
01/09/2011, 07:28 AM
Im confused here..

=WoR=Varth
01/09/2011, 07:28 AM
He still can do if statement.

stock maxexplvl(playerid)
{
if(GetPlayerLevel(playerid, 1) return 1000;
return 1;
}


But switch is faster.

FireCat
01/09/2011, 07:29 AM
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;

leingod
01/09/2011, 07:30 AM
C:\blabla.pwn(1460) : error 076: syntax error in the expression, or invalid function call
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


1 Error.

=WoR=Varth
01/09/2011, 07:33 AM
Kalo mau lebih cepet pake switch gan, kalo bingung caranya tanya aja. Namanya juga tempat diskusi.

leingod
01/09/2011, 07:35 AM
Pasang value 1000 nya dmn? kalo pake switch

=WoR=Varth
01/09/2011, 07:39 AM
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.

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

leingod
01/09/2011, 07:41 AM
Iye udah, makasi yg di OPU nya ^__^
gw kasi reputasi tuh (y)

FireCat
01/09/2011, 07:58 AM
I though this was an english section

Lorenc_
01/09/2011, 08:19 AM
stock MaxExpLVL(playerid)
{
new value;

for( new i; i < 10; i++ ) // MODIFY 10 to MAX LEVELS...
{
if( GetPlayerLevel( playerid ) == i )
{
value = i * 1000;
}
}
return value;
}

Do any of you know a tiny bit of math?

=WoR=Varth
01/09/2011, 08:55 AM
I though this was an english section

Pardon me because there's no Indonesia section.


stock MaxExpLVL(playerid)
{
new value;

for( new i; i < 10; i++ ) // MODIFY 10 to MAX LEVELS...
{
if( GetPlayerLevel( playerid ) == i )
{
value = i * 1000;
}
}
return value;
}

Do any of you know a tiny bit of math?

I'm preety sure I know this:

stock MaxExpLVL(playerid) return GetPlayerLevel(playerid)*1000;


But I'm talking about code speed, not scripting speed.

FireCat
01/09/2011, 09:15 AM
Pardon me because there's no Indonesia section.



I'm preety sure I know this:

stock MaxExpLVL(playerid) return GetPlayerLevel(playerid)*1000;


But I'm talking about code speed, not scripting speed.

Pardon me, do PM's exist in Indonesia?

This section is restricted to english only.

leingod
01/09/2011, 09:20 AM
Thx all ,but little problem :P
On GivePlayerExp(playerid, -maxexplvl(playerid);

When my level increased the exp goin random -200

=WoR=Varth
01/09/2011, 09:30 AM
Pardon me, do PM's exist in Indonesia?

Yes.

This section is restricted to english only.

I just want to help other Indonesia people if they're in the need of this topic and don't understand english well.
Yeah my bad. Maybe you need me to translate it for you?

Thx all ,but little problem :P
On GivePlayerExp(playerid, -maxexplvl(playerid);

When my level increased the exp goin random -200

Let's talk in MSN or ******** (if you want me to help you in Indonesian) before we got the cold one.
MSN:varth_shenon@hotmail.com

Why don't you just set the exp back to 0?

leingod
01/09/2011, 09:34 AM
Let's talk in MSN or ******** (if you want me to help you in Indonesian) before we got the cold one.
MSN:varth_shenon@hotmail.com

Why don't you just set the exp back to 0?

i will add you on ********
pm me ur email
dont hv msn :P