Picking 1 person
#1

Solved
Reply
#2

That would have to be
pawn Код:
new Infected = random(1);
Also if I get this right you can just

pawn Код:
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
    }
}
That was just because I'm not sure what exactly you mean.
Reply
#3

Solved
Reply
#4

Do you want the infected player to be random?

pawn Код:
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];
}
Reply
#5

Solved
Reply
#6

pawn Код:
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;
}
Just made it quickly, should work.

Use this:

pawn Код:
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;
}
Reply
#7

Solved
Reply
#8

Yes. (8chars¬¬)
Reply
#9

Solved
Reply
#10

Solved
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)