public OnPlayerRequestSpawn(playerid) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); if(gTeam[playerid] == TEAM_CIA) { if(strfind(name, "[CIA]", true) != 0) { SendClientMessage(playerid,0xFF8000C8,"You are not a member of the Central Intelligence Agency! Choose another class."); ForceClassSelection(playerid); return 0; } } if(gTeam[playerid] == TEAM_ED) { if(strfind(name, "[ED]", true) != 0) { SendClientMessage(playerid,0xFF8000C8,"You are not a member of the Electric Drifters! Choose another class."); ForceClassSelection(playerid); return 0; } } return 1; }
case TEAM_CIA: { new name[ MAX_PLAYER_NAME ]; GetPlayerName(playerid, name, MAX_PLAYER_NAME); SetPlayerPos(playerid,gCIASP[rand][0],gCIASP[rand][1],gCIASP[rand][2]); SetPlayerFacingAngle(playerid,gCIASP[rand][3]); SendClientMessage(playerid, HOODLUMS_COLOR, "If you are not an official member of the CIA, F4 + /kill and choose another class."); SendClientMessage(playerid, HOODLUMS_COLOR, "If you are caught by an administrator in this class and you're not supposed to be, you will be punished."); SendClientMessage(playerid, HOODLUMS_COLOR, "If you are not a member of the CIA, but would like to be, apply on gw-dm.boards.net"); if(strfind(name,"[CIA]",true) != -1) SendClientMessage(playerid, HOODLUMS_COLOR, "You have spawned as an official Central Intelligence Agency member."); return 1; } case TEAM_ED: { new name[ MAX_PLAYER_NAME ]; GetPlayerName(playerid, name, MAX_PLAYER_NAME); SetPlayerPos(playerid,gEDSP[rand][0],gEDSP[rand][1],gEDSP[rand][2]); SetPlayerFacingAngle(playerid,gEDSP[rand][3]); SendClientMessage(playerid, WORKERS_COLOR, "If you are not an official member of the Electric Drifters, F4 + /kill and choose another class."); SendClientMessage(playerid, WORKERS_COLOR, "If you are caught by an administrator in this class and you're not supposed to be, you will be punished."); SendClientMessage(playerid, WORKERS_COLOR, "If you are not a member of the Electric Drifters, but would like to be, apply on gw-dm.boards.net"); if(strfind(name,"[ED]",true) != -1) SendClientMessage(playerid, WORKERS_COLOR, "You have spawned as an official Electric Drifters member."); return 1; } }
SendClientMessage(playerid,0xFF8000C8,"You are not a member of the Central Intelligence Agency! Choose another class."); ForceClassSelection(playerid); return 0; |
#include <EasyNames>
public OnPlayerRequestSpawn(playerid)
{
switch (gTeam[playerid]) {
case TEAM_CIA : if( (PlayerNameContains(playerid, "[CIA]") == 0) return SendClientMessage(playerid,0xFF8000C8,"You are not a member of the Central Intelligence Agency! Choose another class."),ForceClassSelection(playerid);
case TEAM_ED : if( (PlayerNameContains(playerid, "[ED]") == 0) return SendClientMessage(playerid,0xFF8000C8,"You are not a member of the Electric Drifters! Choose another class."),ForceClassSelection(playerid);
}
return 1;
}
if(gTeam[playerid] == TEAM_CIA) if(strfind(name, "[CIA]", true) != 0) if(gTeam[playerid] == TEAM_ED) if(strfind(name, "[ED]", true) != 0)
public OnPlayerRequestSpawn(playerid) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); printf("OnPlayerRequestSpawn called for: [%i]%s.", playerid, name); if(gTeam[playerid] == TEAM_CIA) { printf("Player IS in the CIA team: [%i]%s.", playerid, name); if(strfind(name, "[CIA]", true) != 0) { printf("Player's name DOES contain '[CIA]': [%i]%s.", playerid, name); SendClientMessage(playerid,0xFF8000C8,"You are not a member of the Central Intelligence Agency! Choose another class."); ForceClassSelection(playerid); return 0; } } if(gTeam[playerid] == TEAM_ED) { printf("Player IS in the ED team: [%i]%s.", playerid, name); if(strfind(name, "[ED]", true) != 0) { printf("Player's name DOES contain '[ED]': [%i]%s.", playerid, name); SendClientMessage(playerid,0xFF8000C8,"You are not a member of the Electric Drifters! Choose another class."); ForceClassSelection(playerid); return 0; } } printf("Spawning Player: [%i]%s.", playerid, name); return 1; }