2 Easy questions.
#1

Hey, What i want is, When the player enters the area, It in gamemodetext says "Safe Zone" When he leaves it Says Left Safe Zone, Also, when you are in the safezone, You are godded, When you leave, Your health goes back to default.

Here is what i have.


pawn Код:
// Above OnGameModeInit:
new safezone;

// OnGameModeInit
safezone = GangZoneCreate(1319.6, -2755.979, 2207.118, -2125.373);

// Player Spawn
GangZoneShowForPlayer(playerid, safezone, 0xFF00007E);
ALSO, How can i make a command bind to a key, Like /lockall is binded to 9 and /unlockall is binded to 0
(NOT NUMPAD)
Reply
#2

Use IsPlayerInArea, and look in Useful Commands for /god
Reply
#3

i allready know god, But yeah, thanks ill have a go.

Reply
#4

np
Reply
#5

Ok, i am forgetting the God for now, But i have done this.

IsPlayerInArea(playerid, 1319.6, -2755.979, 2207.118, -2125.373);
SetplayerHealth(playerid, 10000.00);

Where does that go, I put in Playerspawn, But it says unidentified Symbol IsPlayerInArea And Same again for SetPlayerHealth

Help! xD, Thanks.
Reply
#6

Over main()
pawn Код:
new SafeZoneTimer;
new hasBeenInSafeZone[MAX_PLAYERS];
forward SafeZone();
OnGameModeInit()
pawn Код:
SafeZoneTimer = SetTimer("SafeZone", 200, true);
OnGameModeExit()
pawn Код:
KillTimer(SafeZoneTimer);
Anywhere in script
pawn Код:
public SafeZone()
{
    for(new i=0, m=MAX_PLAYERS; i<m; i++)
    {
        if(IsPlayerInArea(i, 1319.6, -2755.979, 2207.118, -2125.373) && !hasBeenInSafeZone[i])
        {
            GameTextForPlayer(i, "~g~Safe Zone", 2000, 5);
            //Add timer for god here
            hasBeenInSafeZone[i] = 1;
        }
        else if(hasBeenInSafeZone[i])
        {
            GameTextForPlayer(i, "~r~Left Safe Zone", 2000, 5);
            //Kill godtimer
            hasBeenInSafeZone[i] = 0;
        }
    }
    return true;
}
Not tested, but should work
Reply
#7

Thanks Man.

Scorp.

EDIT: error 017: undefined symbol "IsPlayerInArea"
Reply
#8

np
Reply
#9

Read my last post

Quote:
Originally Posted by scorp1543
Thanks Man.

Scorp.

EDIT: error 017: undefined symbol "IsPlayerInArea"
Reply
#10

pawn Код:
stock IsPlayerInArea(playerid, Float:minx, Float:maxx, Float:miny, Float:maxy)
{
    new
        Float:x,
        Float:y,
        Float:z;

    GetPlayerPos(playerid, x, y, z);
    if (x > minx && x < maxx && y > miny && y < maxy) return true;
    return false;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)