How to do this?
#1

I've got this on "OnPlayerSpawn"

pawn Код:
if(PlayerInfo[playerid][pTeam] == 1)
    {
        SetPlayerPos(playerid, 403.6300,2533.5134,16.5457);
    }
    else if(PlayerInfo[playerid][pTeam] == 2)
    {
        SetPlayerPos(playerid, 214.4811,1863.2504,13.1406);
    }
But it's not working, so how can I make it work?

============

EDIT:


Uhm, I have the HnRAvailable[playerid] = 1; in a command, and I want to force it on everyone when I type that command, what should I do?

I have it like HnRAvailable[targetid] = amount; .. So, I also have it in "OnPlayerConnect" and OnDialogResponse when a player registers even logs in.. But it doesn't work
Reply
#2

How is it 'not' working, what do you mean?
+
Код:
SetCameraBehindPlayer(playerid);
Reply
#3

It doesn't read it I think.. I have a tp that sets the players to teams if they type it, but yeah .. It's not like working, everything works except this, I tried putting it in OnPlayerDeath, but nothing ..
Reply
#4

Make sure it's not conflicting with another OnPlayerSpawn in another filterscript/gamemode.
Reply
#5

well sometimes you have set SetSpawnInfo in other place maybe in onplayerconnect or somewhere. Make sure if that isn't the problem
Reply
#6

Okay SetSpawnInfo works, thanks but now my question is:

Will the following code send the "HnRAvailable" for all the players on the server if I did it like that?
pawn Код:
for(new i=1; i<MAX_PLAYERS; i++)
    {
        HnRAvailable[i] = 1;
    }
Or it's just fine as it is

pawn Код:
HnRAvailable[playerid] = 1;
?
Reply
#7

It depends what function you're using it on. If you're using it on OnPlayerConnect, then yes it will work with HnRAvailable[playerid] = 1;

If you're using it in a completely different, or non-public function, then you will need to use:
Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
     HnRAvailable[i] = 1;
}
i = 0, because the server starts with ID 0 by default, not ID 1.
Reply
#8

Oh, alrighty! Thank you, then for my case it's [playerid] ^^
Reply
#9

Uhm, I have the HnRAvailable[playerid] = 1; in a command, and I want to force it on everyone when I type that command, what should I do?
Reply
#10

BUMP!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)