Player level commands -
cigo - 05.06.2009
i have levels, but there is one problem:
i wanted that, when you buy level 1 you cant buy, example, level 3. you have buy level 1, then level 2 and then level 3, but i can buy level 3, not buying level 1 or level 2.
How can I make thatI have buy lvl 1 -> lvl 2 -> lvl 3 . not lvl 1 ->lvl 3 ?
please help, I really need this!
Re: Player level commands -
propilot - 05.06.2009
Well click me if you need level system SEARCH BEFORE POSTING!! :@ God what so hard?? I sew about 25 scripts with the level thingy and more advanced then this SEARCH!! and FIND!! THANK YOU! lol ( Click any where )
Re: Player level commands -
efeX - 05.06.2009
To the guy above me: Stop pasting the same shit in every topic...
Hey cigo, this would just require some if statements!
(assuming you still using the code i gave you earlier)
pawn Код:
if (strcmp(cmd, "/buylevel", true) == 0)
{
gPlayerMoney[playerid] = GetPlayerMoney(playerid);
if (GetPlayerMoney(playerid) >= 250000 && gPlayerLevel[playerid] == 1)
{
gPlayerLevel[playerid] += 1; // level 2
SetPlayerMoney(playerid, gPlayerMoney[playerid] - 250000);
}
if (GetPlayerMoney(playerid) >= 500000 && gPlayerLevel[playerid] == 2)
{
gPlayerLevel[playerid] += 1; // level 3
SetPlayerMoney(playerid, gPlayerMoney[playerid] - 500000);
}
return 1;
}
&& means "and" so basically it's checking if you have the money AND you are level1,2, etc.
So on, so forth
Re: Player level commands -
propilot - 05.06.2009
Quote:
Originally Posted by efeX
To the guy above me: Stop pasting the same shit in every topic...
Hey cigo, this would just require some if statements!
(assuming you still using the code i gave you earlier)
pawn Код:
if (strcmp(cmd, "/buylevel", true) == 0) { gPlayerMoney[playerid] = GetPlayerMoney(playerid); if (GetPlayerMoney(playerid) >= 250000 && gPlayerLevel[playerid] == 1) { gPlayerLevel[playerid] += 1; // level 2 SetPlayerMoney(playerid, gPlayerMoney[playerid] - 250000); } if (GetPlayerMoney(playerid) >= 500000 && gPlayerLevel[playerid] == 2) { gPlayerLevel[playerid] += 1; // level 3 SetPlayerMoney(playerid, gPlayerMoney[playerid] - 500000); } return 1; }
&& means "and" so basically it's checking if you have the money AND you are level1,2, etc.
So on, so forth
|
evrey topic?
wow i dont see it at any topic -_-
only at 2 it not evrey
anyways that what he meant i didnt understand him sorry... -_-
Re: Player level commands -
cigo - 05.06.2009
thanks, i'll try and then we'll know if there is any errors
edit: Command /buylevel don't work! it's like even the command not typed... any ideas?
Re: Player level commands -
efeX - 05.06.2009
Dont copy the strcmp part, because you fixed it remember?
pawn Код:
gPlayerMoney[playerid] = GetPlayerMoney(playerid);
if (GetPlayerMoney(playerid) >= 250000 && gPlayerLevel[playerid] == 1)
{
gPlayerLevel[playerid] += 1; // level 2
SetPlayerMoney(playerid, gPlayerMoney[playerid] - 250000);
SendClientMessage(playerid, 0xFFFFFFFF, "You are now level 2!");
}
else if (GetPlayerMoney(playerid) >= 500000 && gPlayerLevel[playerid] == 2)
{
gPlayerLevel[playerid] += 1; // level 3
SetPlayerMoney(playerid, gPlayerMoney[playerid] - 500000);
SendClientMessage(playerid, 0xFFFFFFFF, "You are now level 3!");
}
else
{
SendClientMessage(playerid, 0xFFFFFFFF, "You can't afford it!");
}
return 1;
Re: Player level commands -
cigo - 06.06.2009
the command was ok - i just wrote wrong numbers!
but now i have some bugs with message what shows when you are trying to use command what is for higher level:
when i write wrong command (what is not in my server) it shows not ''Server - Unknown Command'' , but the message what shows when you're not high enough level? how can i fix this?