PDA

View Full Version : Change NPC id?


bajskorv123
13/02/2010, 02:09 PM
Hey, I have somewhere around 13 NPC's on my server, and when I join, I get ID 13 when i want id 0.
Is there any way to move the npcs so they get id 487 to 500 or something?

EDIT: It should be like a SetPlayerID(playerid, id) function

dice7
13/02/2010, 02:23 PM
you can't

Joe Staff
13/02/2010, 03:16 PM
you can't

Not entirely true.
At OnGameModeInit, you can connect 50 'blank' NPCs, then connect your NPCs, then kick off the 'blank' NPCs

Joe Staff
13/02/2010, 03:21 PM
It's yours :P

bajskorv123
13/02/2010, 03:21 PM
Hannes ]
Hey, I have somewhere around 13 NPC's on my server, and when I join, I get ID 13 when i want id 0.
Is there any way to move the npcs so they get id 487 to 500 or something?

EDIT: It should be like a SetPlayerID(playerid, id) function

you can't

Not entirely true.
At OnGameModeInit, you can connect 50 'blank' NPCs, then connect your NPCs, then kick off the 'blank' NPCs

Brilliant idea, this could actually create SetPlayerID.

It's yours :P

How to connect blank npcs?
I really need this :)

Joe Staff
13/02/2010, 03:25 PM
public OnGameModeInit()
{
new blanknpcamount;
for(new playerid;playerid<GetMaxPlayers()-AMOUNTOFNPCS;playerid++) //Change AMOUNTOFNPCS to be the same of NPCs you plan on connecting
{
ConnectNPC("Jimbo","BLANK");
blanknpcamount++;
}
//ConnectNPCs here
for(new playerid;playerid<blanknpcamount;playerid++)Kick(playerid);
return 1;
}

bajskorv123
13/02/2010, 03:31 PM
Hannes ]




Hannes ]
Hey, I have somewhere around 13 NPC's on my server, and when I join, I get ID 13 when i want id 0.
Is there any way to move the npcs so they get id 487 to 500 or something?

EDIT: It should be like a SetPlayerID(playerid, id) function

you can't

Not entirely true.
At OnGameModeInit, you can connect 50 'blank' NPCs, then connect your NPCs, then kick off the 'blank' NPCs

Brilliant idea, this could actually create SetPlayerID.

It's yours :P

How to connect blank npcs?
I really need this :)


public OnGameModeInit()
{
new blanknpcamount;
for(new playerid;playerid<GetMaxPlayers()-AMOUNTOFNPCS;playerid++) //Change AMOUNTOFNPCS to be the same of NPCs you plan on connecting
{
ConnectNPC("Jimbo","BLANK");
blanknpcamount++;
}
//ConnectNPCs here
for(new playerid;playerid<blanknpcamount;playerid++)Kick(playerid);
return 1;
}


Please explain more in detail :)

bajskorv123
14/02/2010, 08:19 AM
Bump
I really need that explained so i can use it 8)

bajskorv123
26/02/2010, 07:34 AM
public OnGameModeInit()
{
new blanknpcamount;
for(new playerid;playerid<GetMaxPlayers()-AMOUNTOFNPCS;playerid++)
{
ConnectNPC("Jimbo","BLANK");
blanknpcamount++;
}
//ConnectNPCs here
for(new playerid;playerid<blanknpcamount;playerid++)Kick(playerid);
return 1;
}


Please explain more on how to use, i dont get it :'(

Sergei
26/02/2010, 07:40 AM
You will need to set different name for each NPC tho'.

Injectio73
05/05/2012, 09:00 PM
done