Noob question, Levelup - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Noob question, Levelup (
/showthread.php?tid=304532)
Noob question, Levelup -
-Rebel Son- - 18.12.2011
Alright, so i got this function that checks the players kills, and if the kills are a certain ammount, they level up. and proccess continues, so i made it, made a little command that raises the kills, It works for the first level, then it wont continue.
pawn Код:
public Levelup(playerid)
{
if(soldier[playerid] == 1)
{
if(PlayerInfo[playerid][Soldierlv] == 1)
{
if(PlayerInfo[playerid][Kills] == 1)
{
PlayerInfo[playerid][Soldierlv]++;
PlayerInfo[playerid][Level]++;
SendClientMessage(playerid, COLOR_GREEN, "You have leveled up! Congradulations!");
}
if(soldier[playerid] == 1)
{
if(PlayerInfo[playerid][Soldierlv] == 2)
{
if(PlayerInfo[playerid][Kills] == 5)
{
PlayerInfo[playerid][Soldierlv]++;
PlayerInfo[playerid][Level]++;
SendClientMessage(playerid, COLOR_GREEN, "You have leveled up! Congradulations!");
}
}
}
}
}
}
I'm thinking it needs to return 1, but not sure. Anyone got an opinion? or a fix?
EDIT: returned with 1, Still nothing.
Re: Noob question, Levelup -
Norck - 18.12.2011
Check this out:
pawn Код:
public Levelup(playerid)
{
if(soldier[playerid] == 1)
{
if(PlayerInfo[playerid][Soldierlv] == 1)
{
if(PlayerInfo[playerid][Kills] == 1)
{
PlayerInfo[playerid][Soldierlv]++;
PlayerInfo[playerid][Level]++;
SendClientMessage(playerid, COLOR_GREEN, "You have leveled up! Congradulations!");
}
}
else if(PlayerInfo[playerid][Soldierlv] == 2)
{
if(PlayerInfo[playerid][Kills] == 5)
{
PlayerInfo[playerid][Soldierlv]++;
PlayerInfo[playerid][Level]++;
SendClientMessage(playerid, COLOR_GREEN, "You have leveled up! Congradulations!");
}
}
}
return 1;
}
Re: Noob question, Levelup -
-Rebel Son- - 18.12.2011
Still same problem, But thanks for the suggestion buddy.
Re: Noob question, Levelup -
FireCat - 18.12.2011
pawn Код:
public Levelup(playerid)
{
if(soldier[playerid] == 1)
{
if(PlayerInfo[playerid][Soldierlv] == 1)
{
if(PlayerInfo[playerid][Kills] == 1)
{
PlayerInfo[playerid][Soldierlv]++;
PlayerInfo[playerid][Level]++;
SendClientMessage(playerid, COLOR_GREEN, "You have leveled up! Congradulations!");
}
}
}
if(soldier[playerid] == 1)
{
if(PlayerInfo[playerid][Soldierlv] == 2)
{
if(PlayerInfo[playerid][Kills] == 5)
{
PlayerInfo[playerid][Soldierlv]++;
PlayerInfo[playerid][Level]++;
SendClientMessage(playerid, COLOR_GREEN, "You have leveled up! Congradulations!");
}
}
}
}
return 1;
Re: Noob question, Levelup -
-Rebel Son- - 18.12.2011
Right, Firecats worked, Apriciated it. Rep+
Re: Noob question, Levelup -
FireCat - 18.12.2011
Quote:
Originally Posted by -Rebel Son-
Right, Firecats worked, Apriciated it. Rep+
|
It's firecat!
Re: Noob question, Levelup -
-Rebel Son- - 18.12.2011
mybad Firecat!