SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 15/12/2019, 02:46 PM   #1
KayJ
Gangsta
 
KayJ's Avatar
 
Join Date: Apr 2014
Posts: 678
Reputation: 64
Default Mapandreas respawn

PHP Code:
public FCNPC_OnRespawn(npcidkillerid)
{
    new 
Rand random(9);
    switch(
Rand)
    {
        case 
0FCNPC_SetWeapon(npcid1);
        case 
1FCNPC_SetWeapon(npcid2);
        case 
2FCNPC_SetWeapon(npcid3);
        case 
3FCNPC_SetWeapon(npcid4);
        case 
4FCNPC_SetWeapon(npcid5);
        case 
5FCNPC_SetWeapon(npcid6);
        case 
6FCNPC_SetWeapon(npcid7);
        case 
7FCNPC_SetWeapon(npcid8);
        case 
8FCNPC_SetWeapon(npcid15);
    }
    new    
Float:pos[3], x=random(4000)-2000y=random(4000)-2000Float:z;
    for(new 
a100a++)
    {
        
MapAndreas_FindZ_For2DCoord(xyz);
        if(
>= 5.0 && 30.0)
        {
            
pos[0] = x;
            
pos[1] = y;
            
pos[2] = z;
            
FCNPC_Spawn(npcidsData[ZSKIN], xyz);
            break;
        }
    }
    
ZombieHealthLabel(npcid);
    return 
1;

When I use MapAndreas to create npc/zombies it works fine but upon respawn it just spawns the npc right where it died. Any solution?
KayJ is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
mapandreas Pearson Scripting Help 6 27/12/2016 04:20 PM
mapandreas iBots Scripting Help 1 23/09/2014 01:35 PM
Respawn Vehicles don't respawn spawned cars JaKe Elite Scripting Help 6 20/05/2013 07:17 AM
MapAndreas JaKe Elite Scripting Help 5 08/10/2012 12:28 PM
how to respawn the player pos ? respawn(playerid); ?[solved] AlbanianGuy Help Archive 3 24/04/2010 02:22 AM


All times are GMT. The time now is 11:06 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.