public OnPlayerSpawn(playerid)
{
if(IsSpecing[playerid] == 1)
{
SetPlayerPos(playerid,SpecX[playerid],SpecY[playerid],SpecZ[playerid]);// Remember earlier we stored the positions in these variables, now we're gonna get them from the variables.
SetPlayerInterior(playerid,Inter[playerid]);//Setting the player's interior to when they typed '/spec'
SetPlayerVirtualWorld(playerid,vWorld[playerid]);//Setting the player's virtual world to when they typed '/spec'
IsSpecing[playerid] = 0;//Just saying you're free to use '/spec' again YAY :D
IsBeingSpeced[spectatorid[playerid]] = 0;//Just saying that the player who was being spectated, is not free from your stalking >:D
if(team[playerid] == TEAM_HUMAN)
{
HumanSetup(playerid);
SpawnPlayer(playerid);
}
else if(team[playerid] == TEAM_ZOMBIE)
{
ZombieSetup(playerid);
SpawnPlayer(playerid);
}
}
else
{
playersAliveCount++;
CheckToStartMap();
SetPlayerInterior(playerid,Map[Interior]);
if(team[playerid] == TEAM_ZOMBIE)
{
ZombieSetup(playerid);
SetPlayerPos(playerid,Map[ZombieSpawnX],Map[ZombieSpawnY],Map[ZombieSpawnZ]);
}
if(pInfo[playerid][Frozen] == 1) //Get the info outta the enum and check if the player is still frozen
{
TogglePlayerControllable(playerid,0); //Won't let the player move
SendClientMessage(playerid,COLOR_RED,"WARNING: You are still frozen!"); //Send him a message
}
if(team[playerid] == TEAM_HUMAN)
{
HumanSetup(playerid);
switch(random(2))
{
case 0: SetPlayerPos(playerid,Map[HumanSpawnX],Map[HumanSpawnY],Map[HumanSpawnZ]);
case 1: SetPlayerPos(playerid,Map[HumanSpawn2X],Map[HumanSpawn2Y],Map[HumanSpawn2Z]);
}
}
sendClassMessage(playerid);
SendClientMessage(playerid,-1,"{0095FF}You Have 7 Seconds Spawn Protection");
SetPlayerHealth(playerid,99999);
SetTimerEx("NoSpawnKill",7500,0,"i",playerid);
setClass(playerid);
SpawnVars(playerid);
}
return 1;
}
public NoSpawnKill(playerid)
{
SendClientMessage(playerid,-1,"{FF0000}Spawn Protection is Over , you are on your Own .");
SetPlayerHealth(playerid,100.0);
if(pInfo[playerid][pZombieClass] == BOOMERZOMBIE) { SetPlayerHealth(playerid,20); }
if(pInfo[playerid][pZombieClass] == NEMESIS) { SetPlayerHealth(playerid,200); }
return 1;
}
stock sendClassMessage(playerid)
{
new string[128];
format(string,sizeof(string),""chat""COL_YELLOW" You spawned as %s type /class to change your class",GetClassName(playerid));
SendClientMessage(playerid,-1,string);
return 1;
}
setClass(playerid);
SpawnVars(playerid);
public OnPlayerSpawn(playerid) { if(IsSpecing[playerid] == 1) { IsSpecing[playerid] = 0; if(team[playerid] == TEAM_HUMAN) { HumanSetup(playerid); SpawnPlayer(playerid); } else if(team[playerid] == TEAM_ZOMBIE) { ZombieSetup(playerid); SpawnPlayer(playerid); } } else { } return 1; }
stock setClass(playerid)
{
if(team[playerid] == TEAM_HUMAN)
{
ResetPlayerWeapons(playerid);
switch(pInfo[playerid][pHumanClass])
{
case CIVILIAN:
{
GivePlayerWeapon(playerid,23,100);
GivePlayerWeapon(playerid,25,50);
switch(random(15))
{
case 0: SetPlayerSkin(playerid,69);
case 1: SetPlayerSkin(playerid,188);
case 2: SetPlayerSkin(playerid,261);
case 3: SetPlayerSkin(playerid,2);
case 4: SetPlayerSkin(playerid,3);
case 5: SetPlayerSkin(playerid,4);
case 6: SetPlayerSkin(playerid,5);
case 7: SetPlayerSkin(playerid,6);
case 8: SetPlayerSkin(playerid,7);
case 9: SetPlayerSkin(playerid,8);
case 10: SetPlayerSkin(playerid,9);
case 11: SetPlayerSkin(playerid,10);
case 12: SetPlayerSkin(playerid,11);
case 13: SetPlayerSkin(playerid,12);
case 14: SetPlayerSkin(playerid,13);
case 15: SetPlayerSkin(playerid,14);
}
}
case POLICEMAN:
{
GivePlayerWeapon(playerid,24,100);
GivePlayerWeapon(playerid,25,100);
switch(random(6))
{
case 0: SetPlayerSkin(playerid,280);
case 1: SetPlayerSkin(playerid,281);
case 2: SetPlayerSkin(playerid,282);
case 3: SetPlayerSkin(playerid,283);
case 4: SetPlayerSkin(playerid,284);
case 5: SetPlayerSkin(playerid,166);
case 6: SetPlayerSkin(playerid,165);
}
}
case MEDIC:
{
GivePlayerWeapon(playerid,23,350);
GivePlayerWeapon(playerid,25,150);
SetPlayerArmour(playerid,50);
switch(random(3))
{
case 0: SetPlayerSkin(playerid,274);
case 1: SetPlayerSkin(playerid,275);
case 2: SetPlayerSkin(playerid,276);
}
}
case SCOUT:
{
GivePlayerWeapon(playerid,34,40);
GivePlayerWeapon(playerid,23,400);
switch(random(2))
{
case 0: SetPlayerSkin(playerid,230);
case 1: SetPlayerSkin(playerid,252);
}
}
case HEAVYMEDIC:
{
GivePlayerWeapon(playerid,24,150);
GivePlayerWeapon(playerid,25,200);
SetPlayerArmour(playerid,95);
SetPlayerSkin(playerid,274);
}
case FARMER:
{
GivePlayerWeapon(playerid,24,200);
GivePlayerWeapon(playerid,30,100);
GivePlayerWeapon(playerid,33,40);
SetPlayerArmour(playerid,60);
SetPlayerSkin(playerid,161);
}
case ENGINEER:
{
GivePlayerWeapon(playerid,23,450);
GivePlayerWeapon(playerid,25,250);
SetPlayerArmour(playerid,50);
SetPlayerSkin(playerid,27);
}
case SWAT:
{
GivePlayerWeapon(playerid,29,300);
GivePlayerWeapon(playerid,24,100);
SetPlayerArmour(playerid,95);
SetPlayerSkin(playerid,285);
}
case ADVANCEDSWAT:
{
GivePlayerWeapon(playerid,29,500);
GivePlayerWeapon(playerid,24,700);
GivePlayerWeapon(playerid,25,1000);
GivePlayerWeapon(playerid,31,1000);
SetPlayerArmour(playerid,95);
SetPlayerSkin(playerid,286);
}
case HEAVYSHOTGUN:
{
GivePlayerWeapon(playerid,25,300);
GivePlayerWeapon(playerid,24,100);
SetPlayerArmour(playerid,50);
SetPlayerSkin(playerid,25);
}
case ADVANCEDMEDIC:
{
GivePlayerWeapon(playerid,31,100);
GivePlayerWeapon(playerid,24,150);
GivePlayerWeapon(playerid,25,350);
SetPlayerSkin(playerid,275);
SetPlayerArmour(playerid,95);
}
case ADVANCEDENGINEER:
{
GivePlayerWeapon(playerid,24,150);
GivePlayerWeapon(playerid,31,500);
SetPlayerArmour(playerid,95);
SetPlayerSkin(playerid,260);
}
case FEDERALAGENT:
{
GivePlayerWeapon(playerid,31,1000);
GivePlayerWeapon(playerid,24,500);
GivePlayerWeapon(playerid,25,400);
SetPlayerArmour(playerid,95);
SetPlayerSkin(playerid,163);
}
case KICKBACK:
{
GivePlayerWeapon(playerid,23,500);
GivePlayerWeapon(playerid,25,450);
GivePlayerWeapon(playerid,29,200);
SetPlayerSkin(playerid,149);
}
case ADVANCEDSCOUT:
{
GivePlayerWeapon(playerid,34,150);
GivePlayerWeapon(playerid,24,550);
SetPlayerArmour(playerid,50);
SetPlayerSkin(playerid,29);
}
case COWBOY:
{
GivePlayerWeapon(playerid,22,500);
GivePlayerWeapon(playerid,33,200);
SetPlayerArmour(playerid,80);
SetPlayerSkin(playerid,33);
switch(random(5))
{
case 0: SetPlayerSkin(playerid,34);
case 1: SetPlayerSkin(playerid,33);
case 2: SetPlayerSkin(playerid,161);
case 3: SetPlayerSkin(playerid,201);
case 4: SetPlayerSkin(playerid,198);
}
}
case ASSASSIN:
{
GivePlayerWeapon(playerid,8,1);
SetPlayerArmour(playerid,60);
SetPlayerSkin(playerid,123);
}
case PIMP:
{
GivePlayerWeapon(playerid,10,1);
SetPlayerArmour(playerid,50);
SetPlayerSkin(playerid,296);
}
case EXPERIENCEDSCOUT:
{
GivePlayerWeapon(playerid,34,500);
GivePlayerWeapon(playerid,23,500);
SetPlayerArmour(playerid,60);
SetPlayerSkin(playerid,142);
}
case SCIENTIST:
{
GivePlayerWeapon(playerid,23,299);
SetPlayerArmour(playerid,35);
SetPlayerSkin(playerid,240);
}
case TRAPMASTER:
{
GivePlayerWeapon(playerid,27,180);
GivePlayerWeapon(playerid,30,500);
SetPlayerArmour(playerid,40);
switch(random(2))
{
case 0: SetPlayerSkin(playerid,112);
case 1: SetPlayerSkin(playerid,50);
}
}
case VIPENGINEER:
{
GivePlayerWeapon(playerid,31,1000);
GivePlayerWeapon(playerid,25,2000);
GivePlayerWeapon(playerid,24,500);
SetPlayerArmour(playerid,30.0);
SetPlayerSkin(playerid,16);
}
case VIPMEDIC:
{
GivePlayerWeapon(playerid,31,1000);
GivePlayerWeapon(playerid,24,500);
SetPlayerArmour(playerid,70.0);
SetPlayerSkin(playerid,279);
}
case VIPSCOUT:
{
GivePlayerWeapon(playerid,34,130);
GivePlayerWeapon(playerid,24,500);
SetPlayerArmour(playerid,30.0);
SetPlayerSkin(playerid,294);
}
case E_ENGINEER:
{
GivePlayerWeapon(playerid,24,200);
GivePlayerWeapon(playerid,25,100);
SetPlayerArmour(playerid,80.0);
SetPlayerSkin(playerid,260);
}
case SOLDIER:
{
GivePlayerWeapon(playerid,30,300);
GivePlayerWeapon(playerid,24,80);
SetPlayerArmour(playerid,70.0);
SetPlayerSkin(playerid,287);
}
case DOCTOR:
{
GivePlayerWeapon(playerid,23,150);
SetPlayerArmour(playerid,60.0);
SetPlayerSkin(playerid,70);
}
case WEAPONSDEALER:
{
GivePlayerWeapon(playerid,24,250);
GivePlayerWeapon(playerid,29,500);
SetPlayerArmour(playerid,50.0);
SetPlayerSkin(playerid,28);
}
case SHOTGUNSPECIAL:
{
GivePlayerWeapon(playerid,25,500);
SetPlayerArmour(playerid,50.0);
SetPlayerSkin(playerid,67);
}
case VETERAN:
{
GivePlayerWeapon(playerid,24,250);
GivePlayerWeapon(playerid,27,500);
GivePlayerWeapon(playerid,29,1000);
GivePlayerWeapon(playerid,31,1000);
SetPlayerArmour(playerid,95.00);
SetPlayerSkin(playerid,179);
}
}
}
if(team[playerid] == TEAM_ZOMBIE)
{
ResetPlayerWeapons(playerid);
GivePlayerWeapon(playerid,9,1);
SetPlayerArmour(playerid,0);
switch(pInfo[playerid][pZombieClass])
{
case STANDARDZOMBIE: SetPlayerSkin(playerid,181);
case MUTATEDZOMBIE: SetPlayerSkin(playerid,1);
case FASTZOMBIE:
{
SetPlayerSkin(playerid,162);
SetPlayerAttachedObject(playerid, 0, 1549, 1, 0.0199, -0.1169, -0.1920, 0.0000, 94.1000, 0.0000, 1.0000, 1.0000, 1.0000, 0, 0); // "FASTZOMBIE" by Johnny. (Skin:3)
SetPlayerAttachedObject(playerid, 1, 1549, 1, 0.0239, -0.1239, 0.1379, 0.0000, 79.5000, 0.0000, 1.0000, 1.0000, 1.0000, 0, 0); // "FASTZOMBIE" by Johnny. (Skin:3)
SetPlayerAttachedObject(playerid, 2, 2404, 1, 0.3019, -0.0670, 1.3139, 0.0000, 0.0000, 0.0000, 1.0000, 1.0000, 1.0000, 0, 0); // "FASTZOMBIE" by Johnny. (Skin:3)
SetPlayerAttachedObject(playerid, 3, 2404, 1, 0.3109, -0.0750, -1.3500, 0.0000, 0.0000, 0.0000, 1.0000, 1.0000, 1.0000, 0, 0); // "FASTZOMBIE" by Johnny. (Skin:3)
SetPlayerAttachedObject(playerid, 4, 2061, 5, 0.3469, 0.0140, -0.0769, 0.0000, 105.2997, 3.9000, 0.3439, 1.0000, 2.2309, 0, 0); // "FASTZOMBIE" by Johnny. (Skin:3)
}
case REAPERZOMBIE: SetPlayerSkin(playerid,157);
case WITCHZOMBIE: SetPlayerSkin(playerid,196);
case BOOMERZOMBIE: SetPlayerSkin(playerid,264),SetPlayerHealth(playerid,15);
case STOMPERZOMBIE: SetPlayerSkin(playerid,239);
case SCREAMERZOMBIE: SetPlayerSkin(playerid,212);
case FIREBREATHER:
{
switch(random(10))
{
case 0: SetPlayerSkin(playerid,152);
case 1: SetPlayerSkin(playerid,178);
case 2: SetPlayerSkin(playerid,237);
case 3: SetPlayerSkin(playerid,238);
case 4: SetPlayerSkin(playerid,246);
case 5: SetPlayerSkin(playerid,256);
case 6: SetPlayerSkin(playerid,257);
case 7: SetPlayerSkin(playerid,64);
case 8: SetPlayerSkin(playerid,63);
case 9: SetPlayerSkin(playerid,87);
}
SetPlayerAttachedObject(playerid, 0, 6865, 2, 0.0559, -0.0299, 0.0069, 0.4999, 82.9999, -132.0999, 0.1350, 0.1270, 0.0849, 0, 0); // "FIREBREATHER" by Johnny. (Skin:257)
SetPlayerAttachedObject(playerid, 1, 1610, 6, -0.1350, 0.0019, -0.0480, -4.6999, 69.9000, -0.6999, 0.4299, 0.4239, 2.3980, 0, 0); // "FIREBREATHER" by Johnny. (Skin:257)
SetPlayerAttachedObject(playerid, 2, 2041, 5, 0.1759, -0.0789, -0.0339, 129.7997, 0.0000, 98.1000, 1.0000, 1.0000, 1.0000, 0, 0); // "FIREBREATHER" by Johnny. (Skin:257)
SetPlayerAttachedObject(playerid, 3, 3884, 1, -0.4959, 0.0069, 0.0070, -88.8999, 89.8999, 83.1999, 0.5329, 0.5809, 0.3529, 0, 0); // "FIREBREATHER" by Johnny. (Skin:257)
SetPlayerAttachedObject(playerid, 4, 2901, 9, 0.0000, -0.0070, 0.0000, 0.0000, 0.0000, 0.0000, 0.4079, 0.8639, 0.6269, 0, 0); // "FIREBREATHER" by Johnny. (Skin:257)
SetPlayerAttachedObject(playerid, 5, 2901, 10, 0.0000, 0.0339, 0.0000, 0.0000, 0.0000, 0.0000, 0.3849, 0.6760, 0.6759, 0, 0); // "FIREBREATHER" by Johnny. (Skin:257)
SetPlayerAttachedObject(playerid, 6, 2060, 1, -0.2379, 0.0000, 0.0000, 95.5000, -2.4999, 0.0000, 1.0909, 0.9480, 1.0000, 0, 0); // "FIREBREATHER" by Johnny. (Skin:257)
}
case ADVANCEDMUTATED: SetPlayerSkin(playerid,15);
case HEAVYSCREAMER: SetPlayerSkin(playerid,134);
case FLESHEATER: SetPlayerSkin(playerid,213);
case ADVANCEDWITCH:
{
SetPlayerSkin(playerid,198);
SetPlayerAttachedObject(playerid, 0, 1254, 2, 0.0789, -0.0359, 0.0149, 0.0000, 87.5000, -2.0999, 1.3489, 1.3969, 1.2609, 0, 0); // "WITCH" by Johnny. (Skin:69)
SetPlayerAttachedObject(playerid, 1, 3092, 1, 0.0000, -0.2249, 0.0000, 5.7999, 85.2000, 167.7000, 1.0000, 1.0000, 1.0000, 0, 0); // "WITCH" by Johnny. (Skin:69)
SetPlayerAttachedObject(playerid, 2, 1319, 9, -0.2219, 0.0000, 0.0000, 0.0000, 88.0000, 0.1999, 1.8190, 2.3880, 0.7570, 0, 0); // "WITCH" by Johnny. (Skin:69)
SetPlayerAttachedObject(playerid, 3, 1319, 10, -0.2509, 0.0359, 0.0000, 0.0000, 88.3000, -3.5999, 1.7950, 2.4869, 0.7079, 0, 0); // "WITCH" by Johnny. (Skin:69)
SetPlayerAttachedObject(playerid, 4, 2238, 6, 0.3359, 0.0000, 0.0230, 0.0000, 86.7999, 0.0000, 1.0000, 1.0000, 1.0000, 0, 0); // "WITCH" by Johnny. (Skin:69)
SetPlayerAttachedObject(playerid, 5, 2901, 1, 0.0749, 0.0000, 0.0429, 0.0000, 0.0000, 0.0000, 0.4650, 1.0000, 1.0559, 0, 0); // "WITCH" by Johnny. (Skin:69)
}
case ADVANCEDBOOMER:
{
SetPlayerSkin(playerid,259);
SetPlayerAttachedObject(playerid, 0, 3379, 1, 0.0000, -0.7129, -0.1800, -76.0999, 2.1999, 88.4999, 1.0000, 1.0000, 1.0000, 0, 0); // "ADVANCEDBOOMER" by Johnny. (Skin:259)
SetPlayerAttachedObject(playerid, 1, 1636, 5, 0.2059, 0.0260, 0.0000, 0.0000, 3.5999, -83.9999, 1.0000, 1.0000, 1.0000, 0, 0); // "ADVANCEDBOOMER" by Johnny. (Skin:259)
SetPlayerAttachedObject(playerid, 2, 1214, 1, 0.2189, 0.0469, 0.0000, 0.0000, 86.6000, -2.2999, 0.8099, 0.8249, 0.3369, 0, 0); // "ADVANCEDBOOMER" by Johnny. (Skin:259)
SetPlayerAttachedObject(playerid, 3, 1636, 6, 0.1659, 0.0000, 0.0559, 0.0000, -19.1000, -95.5000, 1.0000, 1.0000, 1.0000, 0, 0); // "ADVANCEDBOOMER" by Johnny. (Skin:259)
SetPlayerAttachedObject(playerid, 4, 2429, 1, 0.4629, 0.2370, 0.2269, 0.0000, -93.3999, 0.6000, 1.0000, 1.0000, 1.0000, 0, 0); // "ADVANCEDBOOMER" by Johnny. (Skin:259)
SetPlayerAttachedObject(playerid, 5, 1211, 9, -0.1699, -0.0020, 0.0000, -75.7000, 93.0000, -3.5999, 2.1409, 1.0000, 0.8489, 0, 0); // "ADVANCEDBOOMER" by Johnny. (Skin:259)
SetPlayerAttachedObject(playerid, 6, 1211, 10, -0.1979, 0.0000, 0.0000, 0.0000, 87.0000, 73.2999, 1.6749, 1.0000, 0.9079, 0, 0); // "ADVANCEDBOOMER" by Johnny. (Skin:259)
}
case NEMESIS:
{
SetPlayerSkin(playerid,44);
SetPlayerAttachedObject(playerid, 0, 19314, 2, 0.1089, 0.0000, 0.0000, -5.4999, -8.3000, -2.8999, 1.0000, 1.0000, 1.0000, 0, 0);
SetPlayerAttachedObject(playerid, 1, 19515, 1, 0.0740, 0.0509, 0.0000, 0.0000, 0.0000, 0.0000, 1.0000, 1.0000, 1.0000, 0, 0);
SetPlayerAttachedObject(playerid, 2, 19514, 2, 0.1000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 1.0000, 1.0000, 1.0000, 0, 0);
SetPlayerAttachedObject(playerid, 3, 2041, 6, 0.1790, 0.0000, 0.0819, 4.2999, -0.8999, 82.6000, 1.0000, 1.0000, 1.0000, 0, 0);
SetPlayerAttachedObject(playerid, 4, 2041, 5, 0.2440, 0.0179, -0.0419, 134.5999, 0.0000, 84.9000, 1.0000, 1.0000, 1.0000, 0, 0);
SetPlayerAttachedObject(playerid, 5, 2590, 1, -0.5350, -0.1229, -0.1779, 0.0000, -107.1999, 3.4999, 1.0000, 1.0000, 1.0000, 0, 0);
SetPlayerAttachedObject(playerid, 6, 2589, 1, -4.7890, -0.0979, 0.3429, 0.0000, -86.7000, 0.0000, 1.0000, 1.0000, 1.0000, 0, 0);
SetPlayerHealth(playerid,200);
}
case ADVSTOMPER:
{
SetPlayerSkin(playerid,239);
}
case ADVSCREAMER:
{
SetPlayerSkin(playerid,132);
}
}
}
return 1;
}
stock SpawnVars(playerid)
{
TextDrawHideForPlayer(playerid, ServerIntroOne[playerid]);
TextDrawHideForPlayer(playerid, ServerIntroTwo[playerid]);
ShowTextdrawsAfterConnect(playerid);
return 1;
}
Youarex, the messages were appeared in the chat, so IsSpecing[playerid] is not 1.
|