[Help] A Question
#1

I'm doing a CarDerby on a building, and i need to do so when a player falls off the building he freezes or die's
but i have no idea what the thing i need is called.
some help please
Reply
#2

that will give you a message when they die
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
         SendDeathMessage(killerid, playerid, reason);
         return 1;
}
Reply
#3

Use floats to get a playerpos. Talk to me on MSN.
Reply
#4

Quote:

that will give you a message when they die

It's not what im searching here, but thanks anyways
Reply
#5

oh what are you looking for?
Reply
#6

First you need to create a stock to check if isPlayerInArea. This Stock will be equal to the top of the building. Like that:


pawn Код:
stock IsPlayerInCity(playerid)
{
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid, x, y, z);
    if(x >= 44.60 && y >= -2892.90 && x <= 2997.00 && y <= -768.00) return 1;
    else return 0;
}

After this, you can create a variable to the players that get in the CarDerby Like:

pawn Код:
new InCarDerby[MAX_PLAYERS];
If the player went to the CarDerby, the variable will be:


pawn Код:
InCarDerby[playerid] = 1;

Else


pawn Код:
InCarDerby[playerid] = 0;

So, you make a settime + public, like:

pawn Код:
//In the OnGameModeInit:


SetTimer("SearchCarDerby",1000,1);


//In the End of the GameMode

forward SearchCarDerby();
public SearchCarDerby()
{
    for(new i=0; i<MAX_PLAYERS; i++)//For every players
    {
        if(IsPlayerConnected(i) && IsPlayerInCity(i))//It will check if the player is in the City and connected ?
        {
            if(InCarDerby[playerid] == 1)//If the player is In Derby
            {
                SetPlayerHealth(i, 100);//He will Die
        }   }
    }
}

I hope t have helped
Reply
#7

Код:
Derby.pwn(2518) : error 017: undefined symbol "playerid"
InCarDerby[playerid] = 1;
InCarDerby[playerid] = 0;

i put them there but still get the error.
Reply
#8

I think that you are putting in the wrong place =/, the correct would be in the OnPlayerCommandText or other public that have (playerid) like OnPlayerSpawn(playerid)


If you are putting it in publics that don't have (playerid), put like that:

pawn Код:
for(new i=0; i<MAX_PLAYERS; i++)
{
    InCarDerby[i] = 0;
}
But what i sad was to you understand about it man...
Reply
#9

Yes i did put it in : OnPlayerConnect and OnPlayerCommandText but stupid error still shows up.
i belive it should be under OnPlayerConnect:

Код:
public OnPlayerConnect(playerid)
{
	playerinminigame[playerid] = 0; // Checks if a player is in a minigame
	playercarid[playerid] = -1; // Car that player currently is in, used to check whether the player is in a derby/race car

	playerinderby[playerid] = 0; // Derby
	playerinbloodring[playerid] = -1;

	playerintdm[playerid] = 0; // TeamDM

}
Pff i don't know man im fucking lost in this :S
Reply
#10

It also works here, but try:

pawn Код:
public OnPlayerConnect(playerid)
{
    for(new all=0; all<MAX_PLAYERS; all++)
    {
        playerinminigame[all] = 0; // Checks if a player is in a minigame
        playercarid[all] = -1; // Car that player currently is in, used to check whether the player is in a derby/race car

        playerinderby[all] = 0; // Derby
        playerinbloodring[all] = -1;

        playerintdm[all] = 0; // TeamDM
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)