14.11.2010, 22:29
(
Последний раз редактировалось Kitten; 24.11.2013 в 05:29.
)
Solved
new Infected = random(1);
for(new i = 0; i < MAX_PLAYERS; i++)
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,X,Y,Z);
if(IsPlayerInRangeOfPoint(i,5,X,Y,Z))
{
//Your stuff
}
}
stock GetRandomPlayer() // No idea who wrote it..
{
new yplayer[MAX_PLAYERS+1];
for (new y = 0; y != MAX_PLAYERS; y ++) {
if (IsPlayerConnected(y)) {
yplayer[0] ++;
yplayer[yplayer[0]] = y;
}
}
return yplayer[random(yplayer[0])+1];
}
stock GetRandomID()
{
new rand, count = 0;
do
{
rand = random(MAX_PLAYERS);
count++;
}
while(!IsPlayerConnected(rand) && count < MAX_PLAYERS);
if(count >= MAX_PLAYERS) return INVALID_PLAYER_ID;
else
return rand;
}
public Infected(playerid = GetRandomID())
{
ResetPlayerWeapons(playerid);
SetPlayerColor(playerid,Z_COLOR);
SetPlayerTeam(playerid,TEAM_ZOMBIE);
SetPlayerHealth(playerid,50);
SetPlayerWeather(playerid,32);
SetPlayerTime(playerid,24,0);
new name[MAX_PLAYER_NAME], string4[256];
GetPlayerName(playerid, name, sizeof(name));
format(string4, sizeof(string4), "Player %s has just been infected turned into [Zombie]",name);
SendClientMessageToAll(COLOR_RED,string4);
GameTextForPlayer(playerid,"~r~ YOU JUST BEEN ZOMBIFIED INTO INFECTED SIDE",6000,4);
new skin = random(4);
switch(skin)
{
case 0:SetPlayerSkin(playerid,Z_SKIN2);
case 1:SetPlayerSkin(playerid,Z_SKIN);
case 2:SetPlayerSkin(playerid,137);
}
return 1;
}