War problem
#1

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 ...
Reply
#2

Help !?
Reply
#3

Anyone
Reply
#4

UP...
Reply
#5

Код:
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.
Reply
#6

Код:
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;
Reply
#7

UP , sorry for my inactive
Reply
#8

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


Forum Jump:


Users browsing this thread: 1 Guest(s)