15.09.2015, 00:51
PHP код:
#define STANDARDZOMBIE 2501
on dialog respons
case 0: if(pInfo[playerid][pXP] >= 0) pInfo[playerid][pZombieClass] = 0,pInfo[playerid][pZombieClass] = STANDARDZOMBIE,setClass(playerid); else { SendXPError(playerid,0); }
and this onplayerkeystatechange
if(PRESSED(KEY_WALK))
{
if(team[playerid] == TEAM_ZOMBIE)
{
if(pInfo[playerid][pZombieClass] == STANDARDZOMBIE)
{
new victimid = GetClosestPlayer(playerid);
if(gettime() - 7 < Abilitys[playerid][InfectionNormal]) return GameTextForPlayer(playerid,"~b~ Still recovering",4000,5);
{
if(IsPlayerConnected(victimid))
{
switch(GetPlayerSkin(victimid))
{
case NON_IMMUNE:
{
if(GetDistanceBetweenPlayers(playerid,victimid) < 2.0)
{
if(pInfo[victimid][IsPlayerInfected] == 0)
{
if(pInfo[victimid][pAdminDuty] == 0)
{
new zmstring[256];
InfectPlayerStandard(victimid);
format(zmstring,sizeof(zmstring), ""chat""COL_PINK" %s has been infected by %s",PlayerName(victimid),PlayerName(playerid));
SendClientMessageToAll(-1,zmstring);
GivePlayerXP(playerid,5);
Abilitys[playerid][InfectionNormal] = gettime();
}
else if(pInfo[victimid][pAdminDuty] == 1)
{
SendClientMessage(playerid,COLOR_RED,"That player can't be infected because is on admin duty!");
}
}
else return SendClientMessage(playerid,-1,""chat" Player is already infected!");
}
}
}
}
}
}
}
}
stock ConnectVars(playerid)
{
TextDrawShowForPlayer(playerid, ServerIntroOne[playerid]);
TextDrawShowForPlayer(playerid, ServerIntroTwo[playerid]);
pInfo[playerid][pHumanClass] = CIVILIAN;
pInfo[playerid][pZombieClass] = STANDARDZOMBIE;
team[playerid] = 0;
return 1;
}
stock setclass
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);
}
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);
}
}
stock getclassname
if(team[playerid] == TEAM_ZOMBIE)
{
switch(pInfo[playerid][pZombieClass])
{
case STANDARDZOMBIE: classname = "Standard Zombie";