counting thing now 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: counting thing now working (
/showthread.php?tid=150877)
counting thing now working -
iStarzz - 28.05.2010
When only 1 player is left alive, it does nothing... (this is on OnPlayerDeath)
pawn Код:
if((countalive == 1) && pKilled[playerid] == 0)
{
SetTimer("gamewin", 4000, false);
format(string,sizeof(string), "%s has won the deathmatch!", playername);
GameTextForAll(string, 3000, 4);
}
Re: counting thing now working -
ViruZZzZ_ChiLLL - 28.05.2010
Uhhh... I have a question :
Do you have something like this in your script?
pawn Код:
forward gamewin();
public gamewin()
{
// do something here
return 1;
}
If so, show it to us.
Re: counting thing now working -
iStarzz - 28.05.2010
pawn Код:
forward gamewin();
public gamewin()
{
for(new i = 0; i < MAX_PLAYERS; i++)
if(pKilled[i] == 1)
{
GameTextForPlayer (i, "you lost", 3000, 0);
}
for(new i = 0; i < MAX_PLAYERS; i++)
if(pKilled[i] == 0)
{
GameTextForPlayer (i, "won", 3000, 0); }
}
Re: counting thing now working -
ViruZZzZ_ChiLLL - 28.05.2010
Is that all? if so, here you go :
pawn Код:
forward gamewin();
public gamewin()
{
for(new i = 0; i < MAX_PLAYERS; i++)
if(pKilled[i] == 1)
{
GameTextForPlayer (i, "you lost", 3000, 0);
}
for(new i = 0; i < MAX_PLAYERS; i++)
if(pKilled[i] == 0)
{
GameTextForPlayer (i, "won", 3000, 0); }
}
return 1; // return 1;
}
Re: counting thing now working -
MadeMan - 28.05.2010
Try this:
pawn Код:
if(countalive == 1)
{
SetTimer("gamewin", 4000, false);
format(string,sizeof(string), "%s has won the deathmatch!", playername);
GameTextForAll(string, 3000, 4);
}