PDA

View Full Version : /getallnpc


Proph3t
31/05/2013, 11:03 AM
Hello people,

I have the dayz closed source zombie script and i just love to kill the zombies because it has the best zombie npc's in samp.

So i want a command /getallnpc wich will teleport every npc to me but a bit infront of me so i wont get gangbanged. basicly i want this so me and my friend can just have fun and kill these npc's. i was wondering if this is possible and if you could make this for me in a filterscript. there are 125 zombies npc's in totall.

thanks!

iRage
31/05/2013, 11:22 AM
Use ZCMD for this or convert it to whatever you're using.
CMD:getallnpc(playerid, params)
{
new DetectX, DetectY, Float:pos[3];
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && IsPlayerNPC(i))
{
if(DetectX > DetectY)
{
DetectY++;
SetPlayerPos(i, pos[0], pos[1] + DetectY, pos[2]);
}
else if(DetectX < DetectY)
{
DetectX++;
SetPlayerPos(i, pos[0] + DetectX, pos[1], pos[2]);
}
else
{
DetectY++;
SetPlayerPos(i, pos[0] + DetectX, pos[1] + DetectY, pos[2]);
}
}
}
return 1;
}

Proph3t
31/05/2013, 11:38 AM
nothing happens...

Proph3t
31/05/2013, 11:45 AM
i made it

if (strcmp("/getallnpc", cmdtext, true, 10) == 0)
{
new DetectX, DetectY, Float:pos[3];
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && IsPlayerNPC(i))
{
if(DetectX > DetectY)
{
DetectY++;
SetPlayerPos(i, pos[0], pos[1] + DetectY, pos[2]);
}
else if(DetectX < DetectY)
{
DetectX++;
SetPlayerPos(i, pos[0] + DetectX, pos[1], pos[2]);
}
else
{
DetectY++;
SetPlayerPos(i, pos[0] + DetectX, pos[1] + DetectY, pos[2]);
}
}
}
return 1;
}

Proph3t
31/05/2013, 02:28 PM
anyone help?