Help About Npc
#1

Hi all.
hOW cAN i make Re Spawn CMd that the BOT Npc car dont Re spawn
I Make This CMD But Re Spawned Npc Bots Car When I Use This CMD.... Any One Can Fix It ? TNX + Rep
Код:
#pragma unused params
	for(new i = 0; i < MAX_VEHICLES; i++)
   {
 	 if(!IsPlayerNPC(playerid)) return 0;
     SetVehicleToRespawn(i);
   }
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[News] %sRe Spawned All Cars.",name);
    SendClientMessageToAll(COLOR_PINK, string);
    return 1;
   }
Reply
#2

try
pawn Код:
#pragma unused params
    for(new i = 0; i < MAX_VEHICLES; i++)
   {
     if(IsPlayerInVehicle(-1, i)) continue;
     SetVehicleToRespawn(i);
   }
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[News] %sRe Spawned All Cars.",name);
    SendClientMessageToAll(COLOR_PINK, string);
    return 1;
   }
Reply
#3

Not Work
Reply
#4

help me i Need it
Reply
#5

Try this:
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
    {
        for(new v = 1; v < MAX_VEHICLES; v++)
        {
            if(IsPlayerNPC(i) && IsPlayerInVehicle(i, GetPlayerVehicleID(i))) continue;
            SetVehicleToRespawn(v);
        }
    }
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[News] %sRe Spawned All Cars.",name);
    SendClientMessageToAll(COLOR_PINK, string);
    return 1;
}
Reply
#6

DELETED
Reply
#7

Not Work re Spawned NPC bot Car !!!1
Reply
#8

Oh, mmh, then try to replace the IsPlayerInVehicle with a IsPlayerInAnyVehicle(i);
Reply
#9

Quote:
Originally Posted by Macronix
Посмотреть сообщение
Oh, mmh, then try to replace the IsPlayerInVehicle with a IsPlayerInAnyVehicle(i);
Not Work I Need This
Reply
#10

Last try..

pawn Код:
new bool:notnpcvehicle[MAX_VEHICLES];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerNPC(i) && IsPlayerInAnyVehicle(i)) { notnpcvehicle[GetPlayerVehicleID(i)]=true; }
    }
    for(new v = 0; v < MAX_VEHICLES; v++)
    {
        if(!notnpcvehicle[v])
        {
            SetVehicleToRespawn(v);
        }
    }
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "[News] %sRe Spawned All Cars.",name);
    SendClientMessageToAll(COLOR_PINK, string);
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)