18.08.2012, 20:59
Hi, I have a little problem I've liked to have classes in my server which are only for admins and I did this:
So I want to use a message for player when he try to spawn with admin skin but If I use return SendClientMessage it just ignores return 0; , If I remove "return SendClientMessage" and I press spawn it sends the 3 messages:
and I cannot spawn with that skin if I don't login as an admin.
Can somebody help me to make when player click spawn to be unable to spawn and receive warning message if he is not an admin and not to receive the spawn messages(if I put them at OnPlayerSpawn lines players are receiving them on every spawn if they got killed or something else happens).
pawn Код:
public OnGameModeInit()
{
//I won't link all classes they're about 100
AddPlayerClass(0,-344.9633,1526.4976,75.3570,181.0746,0,0,0,0,0,0);
AddPlayerClass(299,-344.9633,1526.4976,75.3570,181.0746,0,0,0,0,0,0);
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
SendClientMessage(playerid,-1,"-----------------------------------------------------");
SendClientMessage(playerid,-1,"Have fun!");
SendClientMessage(playerid,-1,"-----------------------------------------------------");
new playerskin = GetPlayerSkin(playerid);
if(playerskin == 299) {
if(!IsPlayerAdmin(playerid))//If I put after (playerid)) return SendClientMessage it just sends the message and allows the player to spawn himself
return 0;
}
pawn Код:
SendClientMessage(playerid,-1,"-----------------------------------------------------");
SendClientMessage(playerid,-1,"Have fun!");
SendClientMessage(playerid,-1,"-----------------------------------------------------");
Can somebody help me to make when player click spawn to be unable to spawn and receive warning message if he is not an admin and not to receive the spawn messages(if I put them at OnPlayerSpawn lines players are receiving them on every spawn if they got killed or something else happens).



[/Glow]