Need help :(
#1

Hello.Im making zombie server.first everyone spawn as humans, but after 30 seconds someone got randomly infected and becomes zombie.how i can do that someone randomly changes team to ZOMBIE_TEAM?can anyone help me?


here is some things u may need:


Код:
#define TEAM_HUMAN 0
#define TEAM_ZOMBIE 1
Код:
if(PlayerTeam[playerid] == 1) // ZOMBIE TEAM = 0
Reply
#2

may be this will help you

https://sampwiki.blast.hk/wiki/PAWN_tutorial
Reply
#3

Use foreach.
pawn Код:
#include <foreach>
pawn Код:
forward RandomZombie(MAX_PLAYERS);
pawn Код:
public OnGameModeInit()
{
    SetTimer(RandomZombie, 30000, false);
    return 1;
}
pawn Код:
public RandomZombie(playerid)
{
    new randomplayer = Iter_Random(Player);
    PlayerTeam[randomplayer] = 0;
    SendClientMessage(randomplayer,0x00FF22,"ZOMBIEKING : I have chosen you to be my zombie!");
    return 1;
}
Reply
#4

So... Did it work?
Reply
#5

trying tomorrow, thanks..i tried thing like that but i failed...let see if that works
Reply
#6

Nah I'm immune to failing.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)