PHP код:
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid)) //Checks if the player that just spawned is an NPC.
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname)); //Getting the NPC's name.
if(!strcmp(npcname, "Bussi", true)) //Checking if the NPC's name is Arnold Moore
{
SetPlayerSkin(playerid, 240);
PutPlayerInVehicle(playerid, MyFirstNPCVehicle, 0);
}
/* if(!strcmp(npcname, "puudub_Puudub", true)) //Checking if the NPC's name is Albert Moore
{
SetPlayerSkin(playerid, 47);
}*/
return 1;
}
else
{
SetPlayerSkillLevel(playerid,WEAPONSKILL_PISTOL,998);
SetPlayerSkillLevel(playerid,WEAPONSKILL_PISTOL_SILENCED,999);
SetPlayerSkillLevel(playerid,WEAPONSKILL_DESERT_EAGLE,999);
SetPlayerSkillLevel(playerid,WEAPONSKILL_SHOTGUN,999);
SetPlayerSkillLevel(playerid,WEAPONSKILL_SAWNOFF_SHOTGUN,998);
SetPlayerSkillLevel(playerid,WEAPONSKILL_SPAS12_SHOTGUN,999);
SetPlayerSkillLevel(playerid,WEAPONSKILL_MICRO_UZI,998);
SetPlayerSkillLevel(playerid,WEAPONSKILL_MP5,999);
SetPlayerSkillLevel(playerid,WEAPONSKILL_AK47,999);
SetPlayerSkillLevel(playerid,WEAPONSKILL_M4,999);
SetPlayerSkillLevel(playerid,WEAPONSKILL_SNIPERRIFLE,999);
InitLockDoors(playerid);
STDPlayer[playerid] = 0;
gTeam[playerid] = PlayerInfo[playerid][pTeam]; //Set the Team
if (gTeam[playerid] == 4) //medic / criminal reset team
{
gTeam[playerid] = 3;
}
if(gPlayerLogged[playerid] == 0)
{
if(!IsPlayerNPC(playerid))
{
SendClientMessage(playerid, COLOR_LIGHTRED, "** This server requires a Login BEFORE spawn (Kicked) **");
KickPlayer[playerid] = 1;
}
}
if(gTeam[playerid] == 11 && PlayerInfo[playerid][pLeader] < 1)
{
MedicBill[playerid] = 0;
new rand = random(sizeof(CIV));
SendClientMessage(playerid, COLOR_LIGHTRED, "You are not an Approved Leader, you are now a Civilian !");
PlayerInfo[playerid][pTeam] = 3;
gTeam[playerid] = 3;
SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],-2615.1384,2259.3462,8.1983,0,0,0,0,0,0,0);
PlayerInfo[playerid][pModel] = CIV[rand];
SpawnPlayer(playerid);
}
if(gTeam[playerid] == 5)
{
if(PlayerInfo[playerid][pMember] < 1)
{
MedicBill[playerid] = 0;
new rand = random(sizeof(CIV));
SendClientMessage(playerid, COLOR_LIGHTRED, "You are not a Family Member, you are now a Civilian !");
PlayerInfo[playerid][pTeam] = 3;
gTeam[playerid] = 3;
SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],-2615.1384,2259.3462,8.1983,358.8067,0,0,0,0,0,0);
PlayerInfo[playerid][pModel] = CIV[rand];
SpawnPlayer(playerid);
}
}
if(gTeam[playerid] == 10)
{
if(PlayerInfo[playerid][pMember] != 8)
{
MedicBill[playerid] = 0;
new rand = random(sizeof(CIV));
SendClientMessage(playerid, COLOR_LIGHTRED, "You are not a Member of this Agency, you are now a Civilian !");
PlayerInfo[playerid][pTeam] = 3;
gTeam[playerid] = 3;
SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],-2615.1384,2259.3462,8.1983,358.8067,0,0,0,0,0,0);
PlayerInfo[playerid][pModel] = CIV[rand];
SpawnPlayer(playerid);
}
}
if(gTeam[playerid] == 2 && PlayerInfo[playerid][pMember] > 3)
{
MedicBill[playerid] = 0;
new rand = random(sizeof(CIV));
SendClientMessage(playerid, COLOR_LIGHTRED, "You haven't applied for being an Officer / FBI / National Guard, you are now a Civilian !");
PlayerInfo[playerid][pTeam] = 3;
gTeam[playerid] = 3;
SetSpawnInfo(playerid, gTeam[playerid], CIV[rand],-2615.1384,2259.3462,8.1983,358.8067,0,0,0,0,0,0);
PlayerInfo[playerid][pModel] = CIV[rand];
SpawnPlayer(playerid);
}
if(gTeam[playerid] == 3)
{
if(PlayerInfo[playerid][pMember] > 0 || PlayerInfo[playerid][pLeader] > 0)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "You are part of a Family/Force, you've been forced to the right Class + Char !");
MedicBill[playerid] = 0;
new model = PlayerInfo[playerid][pChar];
if(PlayerInfo[playerid][pMember] == 0) { SetSpawnInfo(playerid, 2, model,-2615.1384,2259.3462,8.1983,358.8067,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pMember] == 1) { SetSpawnInfo(playerid, 2, model,-2615.1384,2259.3462,8.1983,358.8067,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pMember] == 2) { SetSpawnInfo(playerid, 2, model,-2615.1384,2259.3462,8.1983,358.8067,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pMember] == 3) { SetSpawnInfo(playerid, 2, model,-2615.1384,2259.3462,8.1983,358.8067,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 2; gTeam[playerid] = 2; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pMember] == 4) { SetSpawnInfo(playerid, 1, model,-2615.1384,2259.3462,8.1983,358.8067,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 1; gTeam[playerid] = 1; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pMember] == 5) { SetSpawnInfo(playerid, 5, model,-2615.1384,2259.3462,8.1983,358.8067,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pMember] == 6) { SetSpawnInfo(playerid, 5, model,-2615.1384,2259.3462,8.1983,358.8067,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pMember] == 7) { SetSpawnInfo(playerid, 11, model,-2615.1384,2259.3462,8.1983,358.8067,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 11; gTeam[playerid] = 11; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pMember] == 8) { SetSpawnInfo(playerid, 10, model,-2615.1384,2259.3462,8.1983,358.8067,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 10; gTeam[playerid] = 10; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pMember] == 9) { SetSpawnInfo(playerid, 12, model,-2615.1384,2259.3462,8.1983,358.8067,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 12; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pMember] == 10) { SetSpawnInfo(playerid, 12, model,-2615.1384,2259.3462,8.1983,358.8067,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 12; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pMember] == 11) { SetSpawnInfo(playerid, 12, model,-2615.1384,2259.3462,8.1983,358.8067,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 12; gTeam[playerid] = 12; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pMember] == 14) { SetSpawnInfo(playerid, 5, model,-2615.1384,2259.3462,8.1983,358.8067,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pMember] == 15) { SetSpawnInfo(playerid, 5, model,-2615.1384,2259.3462,8.1983,358.8067,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; PlayerInfo[playerid][pModel] = model; }
else if(PlayerInfo[playerid][pMember] == 16) { SetSpawnInfo(playerid, 5, model,-2615.1384,2259.3462,8.1983,358.8067,0,0,0,0,0,0); PlayerInfo[playerid][pTeam] = 5; gTeam[playerid] = 5; PlayerInfo[playerid][pModel] = model; }
SpawnPlayer(playerid);
}
}
if(PlayerInfo[playerid][pChar] > 0) { SetPlayerSkin(playerid, PlayerInfo[playerid][pChar]); }
else { SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]); }
SetPlayerWeapons(playerid);
SetPlayerSpawn(playerid);
SetPlayerToTeamColor(playerid);
PlayerFixRadio(playerid);
FirstSpawn[playerid] = 0;
for(new i = 0; i < sizeof(Turfs); i++)
{
GangZoneShowForPlayer(playerid, i, TurfInfo[i][zColor]);
return 1;
}
if(MapIconsShown[playerid] != 1)
{
MapIconsShown[playerid] = 1;
for(new i = 0; i < sizeof(BizzInfo); i++)
{
SetPlayerMapIcon(playerid,i + 1,BizzInfo[i][bEntranceX],BizzInfo[i][bEntranceY],BizzInfo[i][bEntranceZ],36,COLOR_LIGHTRED);
}
for(new i = 0; i < sizeof(SBizzInfo); i++)
{
SetPlayerMapIcon(playerid,i + 20,SBizzInfo[i][sbEntranceX],SBizzInfo[i][sbEntranceY],SBizzInfo[i][sbEntranceZ],36,COLOR_LIGHTRED);
}
}
}
return 1;
}