17.08.2010, 03:51
Код:
if(strcmp(cmd, "/joinevent", true) == 0) { if(IsPlayerConnected(playerid)) { if(ActiveEvent == 1) { if(EventLocked == 1) { SendClientMessage(playerid, COLOR_GREY, " The event is currently locked !"); return 1; } if(IsAtEvent[playerid] == 1) { SendClientMessage(playerid, COLOR_GREY, " You have already joined the event !"); return 1; } if(EventX == 0.0 && EventY == 0.0 && EventZ == 0.0) { SendClientMessage(playerid, COLOR_GREY, " The event spawn has not been set !"); return 1; } SetPlayerPos(playerid, EventX, EventY, EventZ); IsAtEvent[playerid] = 1; SetPlayerVirtualWorld(playerid, EventWorld); SetPlayerInterior(playerid, EventInt); SetPlayerHealth(playerid, EventHP); SetPlayerArmour(playerid, EventArmour); ResetPlayerAdminWeaponsEx(playerid); ResetPlayerWeapons(playerid); GivePlayerAdminGun(playerid, EventWeapon1); GivePlayerAdminGun(playerid, EventWeapon2); GivePlayerAdminGun(playerid, EventWeapon3); GivePlayerAdminGun(playerid, EventWeapon4); GivePlayerAdminGun(playerid, EventWeapon5); if(EventJoinText == 1) { GameTextForPlayer(playerid, EventText, 5000, 0); } SendClientMessage(playerid, COLOR_WHITE, "You have been teleported to the event."); } else { SendClientMessage(playerid, COLOR_GREY, " There are currently no events active !"); } } return 1;