19.09.2016, 15:49
Quote:
Just easy tricks:
PHP код:
If you wanna have Zombie NPCs you have to use a Plugin..like FCNPC Just look at some tutorials how you create them |
The only problem is, I use the command /zombie to add a zombie and the number goes up each time. Example, /zombie would create a zombie called "Zombie_1" then using the command again would create "Zombie_2" etc... so how would I get the zombies name?
This is the code in the filterscript for getting the zombie name, would I add that into the OnPlayerSpawn in my gamemode?
PHP код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/zombie", true) == 0) {
if(!IsPlayerAdmin(playerid)) return false;
Caller = playerid;
new newname[64];
format(newname,sizeof(newname),"%s_%d",ZOMBIE_NAME,LastAdded);
ConnectNPC(newname,"zombie");
LastAdded++;
return 1;
}
return 0;
}