SA-MP Forums Archive
War problem - 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: War problem (/showthread.php?tid=552563)



War problem - Mititel - 25.12.2014

Hi,

We have a system of war GF (/ startwar) course when you / startwar game takes place in another world. (VirtualWorld). We have three different areas marked in red fication and I would like when you arrive in the area and then exit the area marked in red to show them a message: "A time 5,4,3,2,1 seconds you returned to area, otherwise you will lose HP "and after them all fall to 5 HP to enter the area.

What I tried:

Код:
public OnPlayerEnterDynamicArea(playerid, areaid)
{
if(areaid == warloc1)
    {
      SendClientMessage(playerid, COLOR_WHITE, "* Ai intrat in zona de war !");
      KillTimer(WarzoneExit(playerid));
      }
      return 1;
}

public OnPlayerLeaveDynamicArea(playerid, areaid)
{
     if(areaid == warloc1)
     {
         SetTimer("WarzoneExit", 5000, true);
         SendClientMessage(playerid, COLOR_WHITE, "* Ai timp 5 secunde pentru a te reintoarce in zona pentru a nu pierde HP !");
        }
    return 1;
}

forward WarzoneExit(playerid);
public WarzoneExit(playerid)
{
      new Float:playerHealth = 0;
        GetPlayerHealth ( playerid, playerHealth );
       SetPlayerHealth(playerid, ( playerHealth -5.0 ) );
       SendClientMessage(playerid, COLOR_WHITE, "* Ai pierdut -5 HP ! Intoarcete in zona de war !");
}
When we tested is the first area I do not put me ... and I do not appears and the area is defined ...


Re: War problem - Mititel - 26.12.2014

Help !?


Re: War problem - Mititel - 29.12.2014

Anyone


Re: War problem - Mititel - 31.12.2014

UP...


Re: War problem - ball - 31.12.2014

Код:
public OnGameModeInit()
{
	return SetTimer("WarzoneExit", 5000, true);
}

forward WarzoneExit();
public WarzoneExit()
{
	new Float:health;

	for(new playerid; playerid != MAX_PLAYERS; playerid++)
	{
		if(!IsPlayerConnected(playerid)) || IsPlayerInDynamicArea(playerid, warloc1)) continue;

		//player isn't in the area
	}
}
Learn something about timers ... if you want put arguments like playerid, vehicleid or something else you must use SetTimerEx. SetTimer doesn't support arguments, so playerid in your code will be always default value - 0.


Re: War problem - Mititel - 06.03.2015

Код:
C:\Users\vlad\Desktop\gm.pwn(17153) : warning 202: number of arguments does not match definition
C:\Users\vlad\Desktop\gm.pwn(20866) : error 029: invalid expression, assumed zero
C:\Users\vlad\Desktop\gm.pwn(20866) : error 001: expected token: ";", but found ")"
C:\Users\vlad\Desktop\gm.pwn(20866) : error 029: invalid expression, assumed zero
C:\Users\vlad\Desktop\gm.pwn(20866) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Linies:

Код:
 KillTimer(WarzoneExit(playerid));
Код:
if(!IsPlayerConnected(playerid)) || IsPlayerInDynamicArea(playerid, warloc1)) continue;



Re: War problem - Mititel - 19.08.2015

UP , sorry for my inactive


Re: War problem - Mititel - 03.09.2015

Quote:
Originally Posted by Mititel
Посмотреть сообщение
UP , sorry for my inactive
UP?!?!?!