[Help] Some questions! - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [Help] Some questions! (
/showthread.php?tid=241632)
[Help] Some questions! -
leaNN! - 18.03.2011
Hi all!
Well, im trying to make a payday system, and im not sure if this will work.
The code:
pawn Код:
public Payday(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
pInfo2[i][Exp] = pInfo2[i][Exp] + 1;
if(pInfo[playerid][Nivel] < 1)
{
if(pInfo2[playerid][Exp] >= 15)
{
pInfo2[playerid][Exp] = 0;
pInfo[playerid][Nivel] ++;
SendClientMessage(playerid, COLOR_LIGHTGREEN, "[Info]Subiste un nivel! Ahora eres nivel 2");
}
}
else if(pInfo[playerid][Nivel] < 2)
{
if(pInfo2[playerid][Exp] >= 30)
{
pInfo2[playerid][Exp] = 0;
pInfo[playerid][Nivel] ++;
SendClientMessage(playerid, COLOR_LIGHTGREEN, "[Info]Subiste un nivel! Ahora eres nivel 3");
}
}
else if(pInfo[playerid][Nivel] < 3)
{
if(pInfo2[playerid][Exp] >= 60)
{
pInfo2[playerid][Exp] = 0;
pInfo[playerid][Nivel] ++;
SendClientMessage(playerid, COLOR_LIGHTGREEN, "[Info]Subiste un nivel! Ahora eres nivel 4");
}
}
else if(pInfo[playerid][Nivel] < 4)
{
if(pInfo2[playerid][Exp] >= 90)
{
pInfo2[playerid][Exp] = 0;
pInfo[playerid][Nivel] ++;
SendClientMessage(playerid, COLOR_LIGHTGREEN, "[Info]Subiste un nivel! Ahora eres nivel 5");
}
}
else if(pInfo[playerid][Nivel] < 5)
{
if(pInfo2[playerid][Exp] >= 120)
{
pInfo2[playerid][Exp] = 0;
pInfo[playerid][Nivel] ++;
SendClientMessage(playerid, COLOR_LIGHTGREEN, "[Info]Subiste un nivel! Ahora eres nivel 6");
}
}
else if(pInfo[playerid][Nivel] < 6)
{
if(pInfo2[playerid][Exp] >= 150)
{
pInfo2[playerid][Exp] = 0;
pInfo[playerid][Nivel] ++;
SendClientMessage(playerid, COLOR_LIGHTGREEN, "[Info]Subiste un nivel! Ahora eres nivel 7");
}
}
else if(pInfo[playerid][Nivel] < 7)
{
if(pInfo2[playerid][Exp] >= 180)
{
pInfo2[playerid][Exp] = 0;
pInfo[playerid][Nivel] ++;
SendClientMessage(playerid, COLOR_LIGHTGREEN, "[Info]Subiste un nivel! Ahora eres nivel 8");
}
}
else if(pInfo[playerid][Nivel] < 8)
{
if(pInfo2[playerid][Exp] >= 210)
{
pInfo2[playerid][Exp] = 0;
pInfo[playerid][Nivel] ++;
SendClientMessage(playerid, COLOR_LIGHTGREEN, "[Info]Subiste un nivel! Ahora eres nivel 9");
}
}
else if(pInfo[playerid][Nivel] < 9)
{
if(pInfo2[playerid][Exp] >= 240)
{
pInfo2[playerid][Exp] = 0;
pInfo[playerid][Nivel] ++;
SendClientMessage(playerid, COLOR_LIGHTGREEN, "[Info]Subiste un nivel! Ahora eres nivel 10");
}
}
SendClientMessage(i, COLOR_LIGHTGREEN, "[Payday]Recibiste 1 de experiencia por el Payday!");
SetPlayerScore(playerid, pInfo[playerid][Nivel]);
}
return 1;
}
(Im from argentina :B)
Thank u all!
Re: [Help] Some questions! -
maramizo - 18.03.2011
Should work.
Respuesta: [Help] Some questions! -
leaNN! - 18.03.2011
Im using the SetTimer function in OnGameModeInit callback, it doesn't matters?
(Sorry my bad english :B)