Not Working.. - 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: Not Working.. (
/showthread.php?tid=585041)
Not Working.. -
andreistalker - 10.08.2015
This is not working anymore:
PHP код:
public updatemoney()
{
foreach(Player, i)
{
if(gLogged[i] == 1){
P_Data[i][pCash] = GetPlayerMoney(i);
new query[256];
mysql_format(handle, query, sizeof(query), "UPDATE `conturi` SET `Cash`='%d', 'Level'='%d', 'Skin'='%d' WHERE `Nume`='%s'", P_Data[i][pCash], P_Data[i][pLevel],P_Data[i][pSkin],GetName(i));// facem update-ul la baza de date
mysql_query(handle, query);
}
}
return 1;
}
After I added this :
PHP код:
public xp()
{
foreach(Player, i)
{
new query[256], maxp;
P_Data[i][pXP] = P_Data[i][pXP] + 1;
mysql_format(handle, query, sizeof(query), "UPDATE `conturi` SET `XP`='%d' WHERE `Nume`='%s'", P_Data[i][pXP],GetName(i));
mysql_query(handle, query);
if(P_Data[i][pLevel] == 1)
{
maxp = 60;
P_Data[i][pXPm] = maxp;
if(P_Data[i][pXP] >= maxp)
{
P_Data[i][pXP] = 0;
P_Data[i][pLevel] = P_Data[i][pLevel] + 1;
}
}
if(P_Data[i][pLevel] == 2)
{
maxp = 120;
P_Data[i][pXPm] = maxp;
if(P_Data[i][pXP] >= maxp)
{
P_Data[i][pXP] = 0;
P_Data[i][pLevel] = P_Data[i][pLevel] + 1;
}
}
if(P_Data[i][pLevel] == 3)
{
maxp = 300;
P_Data[i][pXPm] = maxp;
if(P_Data[i][pXP] >= maxp)
{
P_Data[i][pXP] = 0;
P_Data[i][pLevel] = P_Data[i][pLevel] + 1;
}
}
if(P_Data[i][pLevel] == 4)
{
maxp = 600;
P_Data[i][pXPm] = maxp;
if(P_Data[i][pXP] >= maxp)
{
P_Data[i][pXP] = 0;
P_Data[i][pLevel] = P_Data[i][pLevel] + 1;
}
}
if(P_Data[i][pLevel] == 5)
{
maxp = 800;
P_Data[i][pXPm] = maxp;
if(P_Data[i][pXP] >= maxp)
{
P_Data[i][pXP] = 0;
P_Data[i][pLevel] = P_Data[i][pLevel] + 1;
}
}
if(P_Data[i][pLevel] == 6)
{
maxp = 900;
P_Data[i][pXPm] = maxp;
if(P_Data[i][pXP] >= maxp)
{
P_Data[i][pXP] = 0;
P_Data[i][pLevel] = P_Data[i][pLevel] + 1;
}
}
if(P_Data[i][pLevel] == 7)
{
maxp = 1120;
P_Data[i][pXPm] = maxp;
if(P_Data[i][pXP] >= maxp)
{
P_Data[i][pXP] = 0;
P_Data[i][pLevel] = P_Data[i][pLevel] + 1;
}
}
if(P_Data[i][pLevel] == 8)
{
maxp = 1210;
P_Data[i][pXPm] = maxp;
if(P_Data[i][pXP] >= maxp)
{
P_Data[i][pXP] = 0;
P_Data[i][pLevel] = P_Data[i][pLevel] + 1;
}
}
if(P_Data[i][pLevel] == 9)
{
maxp = 1500;
P_Data[i][pXPm] = maxp;
if(P_Data[i][pXP] >= maxp)
{
P_Data[i][pXP] = 0;
P_Data[i][pLevel] = P_Data[i][pLevel] + 1;
}
}
if(P_Data[i][pLevel] == 10)
{
maxp = 1800;
P_Data[i][pXPm] = maxp;
if(P_Data[i][pXP] >= maxp)
{
P_Data[i][pXP] = 0;
P_Data[i][pLevel] = P_Data[i][pLevel] + 1;
}
}
}
}
Each have a timer, updatemoney have 1 sec timer, and xp have 1 min timer
Re: Not Working.. -
andreistalker - 10.08.2015
Nobody can help?
Re: Not Working.. -
andreistalker - 10.08.2015
I resolved it