Thread: Chars spawn
View Single Post
Old 06-07-2009   #4
rappo
Professional Dumbass
 
rappo's Avatar
 
Join Date: Aug 2003
Location: Los Angeles
Posts: 7,012
rappo is a God.rappo is a God.rappo is a God.rappo is a God.rappo is a God.rappo is a God.rappo is a God.rappo is a God.rappo is a God.rappo is a God.rappo is a God.
You use the CreateChar function, but first you need to request the model and then wait until it's loaded, otherwise your game will crash. This example is using the CustomFiberThread, you CANNOT put the while loop in CustomThread, it has to be CustomFiberThread:

Code:
eModel pedModel = MODEL_IG_RICKY;
Ped ped;

RequestModel(pedModel);

while(!HasModelLoaded(pedModel)) {
   wait(0);
}

CreateChar(26, pedModel, x + 2, y + 2, z, &ped, 0);
The x, y, and z are just the coordinates of Niko, and you can put +2 so that they don't spawn right on top of you. That example will spawn the Ricky Gervais model, but there's a huge list of all the models inside ScriptHook/ScriptingEnums.h file.

If you need some more help with it, I can give you my full Bodyguard Mod source code.
__________________
rappo is offline   Reply With Quote