25.02.2015, 17:21
Hello,
How do I make an entrance to be locked for all the players on the server?
Let's say we've door A which's a faction door. Only the leader can lock the door.
I tried doing:
and for example:
How do I check if the door's locked & if it is to unlock it, I think I got an idea how to do that but the real question's:
If I do it that way, wouldn't the players that just connect have doorLocked = 0; meaning they can enter the specified door?
To sum it all up, I want someone to show me how to make a door be locked & unlocked for everyone on the server and when it's locked to be locked on those that join too.
How do I make an entrance to be locked for all the players on the server?
Let's say we've door A which's a faction door. Only the leader can lock the door.
I tried doing:
PHP код:
doorLocked[ MAX_PLAYERS ];
PHP код:
CMD:lockdoor( playerid, cmdtext[] ) {
if(IsPlayerConnected(playerid))
{
new string[128]; // the if player is leader etc I know how to do it this is just an example
format(string, sizeof(string), "%s has locked door A", GetOOCName(playerid));
SendMessageToAll(example, red, string);
foreach( new i : Player )
{
doorLocked = 1;
}
return 1;
}
return 0;
}
If I do it that way, wouldn't the players that just connect have doorLocked = 0; meaning they can enter the specified door?
To sum it all up, I want someone to show me how to make a door be locked & unlocked for everyone on the server and when it's locked to be locked on those that join too.