25.06.2009, 06:56
Hello,
I wanted to create an interior (in which you go with /enter) but i want the script to check if someone is already inside.
So if someone is inside they would get a message like "Can't go inside right now, it's occupied!" so i started it like this:
On the top of my script i put:
new InRoom[MAX_PLAYERS];
Then i put this in OnPlayerConnect:
InRoom[playerid] = 0;
And then i made my check like this:
It worked when i was alone on the server, but will it work for others ?
For instance, if i enter that interior could another player enter aswell ? (with my code)
Please tell my if this code is ok, or if it's not please tell me how to fix it. THANKS
I wanted to create an interior (in which you go with /enter) but i want the script to check if someone is already inside.
So if someone is inside they would get a message like "Can't go inside right now, it's occupied!" so i started it like this:
On the top of my script i put:
new InRoom[MAX_PLAYERS];
Then i put this in OnPlayerConnect:
InRoom[playerid] = 0;
And then i made my check like this:
pawn Код:
if(InRoom[playerid] == 1)
{
SendClientMessage(playerid, 0xF6345BAA, "Can't go inside sorry ..");
return 1;
}
For instance, if i enter that interior could another player enter aswell ? (with my code)
Please tell my if this code is ok, or if it's not please tell me how to fix it. THANKS