Clans War [help smth fast please ] - 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: Clans War [help smth fast please ] (
/showthread.php?tid=601001)
Clans War [help smth fast please ] -
ThatFag - 15.02.2016
hey guys.
This is my first thread and i need some help with this clan wars.
I have made an war system but there is final war points, so i decieded to remove it and make it like when First clan arrives 500 points + from other clan points he will be declared winner. but i really dont know to do this so basicly that what i need help with.The 300 is number that i wanted to make winner clan when they arrive + other clans points, please help me out.
Here is my script that makes an clan winner.
Код HTML:
stock WarProgress()
{
if(dini_Int(warinffos, "clan1") != -1)
{
new wWINNER = -1, clanex1 = dini_Int(warinffos,"clan1"), clanex2 = dini_Int(warinffos,"clan2");
if( dini_Int(warinffos, "clan1points") >= dini_Int(warinffos, "clan2points")+300 )
{
wWINNER = factionex1;
}
if( dini_Int(warinffos, "clan2points") >= dini_Int(warinffos, "clan1points")+300 )
{
wWINNER = factionex2;
}
if(wWINNER != -1)
{
PlayerLoop(i)
{
if(PLAYERLIST_authed[i])
{
new string[ 128 ];
format(string, sizeof(string), "..:: [ WAR INFORMATION ] %s has won the ongoing war! ::..", clanteams[ GetTeam(wWINNER) ][clanname]);
SendClientMessage(i, COLOR_WHITE, string);
format(string, sizeof(string), "~g~%s wins!", teams[ GetTeam(wWINNER) ][teamname]);
GameTextForAll(string, 5000, 3);
ResetWar();
}
}
}
}
}
Re: Clans War [help smth fast please ] -
ThatFag - 17.02.2016
bumppw
Re: Clans War [help smth fast please ] -
Sew_Sumi - 17.02.2016
I'd be querying the local variables for scores, and check the clans are on in that way too. I think seeing as you're asking the dini a heap, in a short time (Being this would likely be on a 1 second timer) it'll cause you trouble.
This could have something to do with this, however.
How often are the accounts/stats being saved, as if that isn't working, that would stop the points being picked up as being a win in the war.