08.06.2012, 19:35
Hola estoy creando un mini gm zombie y quiero saber como le hago q cuando hagan spawn a los 30 segundo se elija cualquier id para ser zombie
#include <a_samp>
#define COUNT_BOTS //comentar esta linea para que el script no cuente a los bots NPC.
new pCount;
public OnPlayerConnect(playerid)
{
#if defined COUNT_BOTS
pCount++;
#else
if(!IsPlayerNPC(playerid))
pCount++;
#endif
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
#if defined COUNT_BOTS
pCount++;
#else
if(!IsPlayerNPC(playerid))
pCount++;
#endif
return 1;
}
stock RandomUser()
{
if(!pCount)
return INVALID_PLAYER_ID;
if(pCount < 2){
new tmp, counter;
while(!IsPlayerConnected(tmp)){
if(tmp == GetMaxPlayers()){
counter++;
if(counter>=2)
return INVALID_PLAYER_ID;
tmp=0;
}
tmp++;
}
return tmp;
}
new tmp = random(GetMaxPlayers());
while(!IsPlayerConnected{tmp})tmp = random(GetMaxPlayers());
return tmp;
}
IsPlayerNPC |
while(!IsPlayerConnected{tmp})tmp = random(GetMaxPlayers());
while(!IsPlayerConnected(tmp))tmp = random(GetMaxPlayers());