/getallnpc - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /getallnpc (
/showthread.php?tid=440794)
/getallnpc -
Proph3t - 31.05.2013
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!
Re: /getallnpc -
iRage - 31.05.2013
Use ZCMD for this or convert it to whatever you're using.
pawn Код:
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;
}
Re: /getallnpc -
Proph3t - 31.05.2013
nothing happens...
Re: /getallnpc -
Proph3t - 31.05.2013
i made it
pawn Код:
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;
}
Re: /getallnpc -
Proph3t - 31.05.2013
anyone help?