22.06.2011, 13:45
Hey everyone,
I have a problem when I try to set my NPC's skins...
Well, it works to apply an animation, to give them weapons, to set colors or others like that, but the skin doesn't change. My NPC's takes the first skin from AddPlayerClass (OnGameModeInit):
Someone give me a hand? Please help.
I have a problem when I try to set my NPC's skins...
Well, it works to apply an animation, to give them weapons, to set colors or others like that, but the skin doesn't change. My NPC's takes the first skin from AddPlayerClass (OnGameModeInit):
Код:
public OnPlayerSpawn(playerid) { if(IsPlayerNPC(playerid)) { new npcname[MAX_PLAYER_NAME]; GetPlayerName(playerid, npcname, sizeof(npcname)); if(!strcmp(npcname,"FServer",true)) { ResetPlayerWeapons(playerid); SetPlayerPos(playerid, 1958.33, 1343.12, 15.36); SetPlayerFacingAngle(playerid, 269.15); //PutPlayerInVehicle(playerid, Random, 0); SetPlayerSkin(playerid, 80); SetPlayerColor(playerid,0xFFFFFF32); SetPlayerInterior(playerid,5); ApplyAnimation(playerid,"GYMNASIUM","GYMshadowbox",4.0,1,1,1,1,0); // new Text3D:flabel,string[256]; //format(string, sizeof(string), "FBOT (%d)",playerid); //flabel = Create3DTextLabel(string,COLOR_GREEN,0,0,0,25.0,0,1); //Attach3DTextLabelToPlayer(flabel, playerid, 0, 0, 0); } if(!strcmp(npcname,"FServer2",true)) { ResetPlayerWeapons(playerid); SetPlayerPos(playerid, 1958.33, 1343.12, 15.36); SetPlayerFacingAngle(playerid, 269.15); //PutPlayerInVehicle(playerid, Random, 0); SetPlayerSkin(playerid, 81); SetPlayerColor(playerid,0xFFFFFF00); SetPlayerInterior(playerid,5); ApplyAnimation(playerid,"GYMNASIUM","GYMshadowbox",4.0,1,1,1,1,0); } if(!strcmp(npcname,"FServer3",true)) { ResetPlayerWeapons(playerid); SetPlayerPos(playerid, 1958.33, 1343.12, 15.36); SetPlayerFacingAngle(playerid, 269.15); //PutPlayerInVehicle(playerid, Random, 0); SetPlayerColor(playerid,0xFFFFFFFF); SetPlayerInterior(playerid,5); SetPlayerSkin(playerid, 164); ApplyAnimation(playerid,"SMOKING","M_smk_out", 4.0, 1, 0, 0, 0, 0); SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_WINE); } if(!strcmp(npcname,"FServer4",true)) { ResetPlayerWeapons(playerid); SetPlayerPos(playerid, 1958.33, 1343.12, 15.36); SetPlayerFacingAngle(playerid, 269.15); //PutPlayerInVehicle(playerid, Random, 0); SetPlayerColor(playerid,0xFFFFFFFF); SetPlayerInterior(playerid,0); SetPlayerSkin(playerid, 116); new Frand = random(3); switch(Frand) { case 0: { ApplyAnimation(playerid,"SMOKING", "M_smklean_loop", 4.0, 1, 0, 0, 0, 0); SetPlayerSpecialAction(playerid,SPECIAL_ACTION_SMOKE_CIGGY); } case 1: { ApplyAnimation(playerid, "ped", "cower", 3.0, 1, 0, 0, 0, 0); } case 2: { SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP); } } } if(!strcmp(npcname,"FServer5",true)) { ResetPlayerWeapons(playerid); SetPlayerPos(playerid, 1958.33, 1343.12, 15.36); SetPlayerFacingAngle(playerid, 269.15); //PutPlayerInVehicle(playerid, botcar, 0); SetPlayerSkin(playerid, 162); SetPlayerColor(playerid,0xFFFFFFFF); SetPlayerInterior(playerid,6); ApplyAnimation(playerid,"PARK","Tai_Chi_Loop",4.0,1,0,0,0,0); } if(!strcmp(npcname,"FServer6",true)) { ResetPlayerWeapons(playerid); SetPlayerPos(playerid, 1958.33, 1343.12, 15.36); SetPlayerFacingAngle(playerid, 269.15); //PutPlayerInVehicle(playerid, Random, 0); SetPlayerColor(playerid,0xFFFFFFFF); SetPlayerInterior(playerid,6); SetPlayerSkin(playerid, 270); new Frand = random(2); switch(Frand) { case 0: { ApplyAnimation(playerid,"PED","KO_shot_stom",4.0,0,1,1,1,0); } case 1: { ApplyAnimation(playerid, "SWEET", "Sweet_injuredloop", 4.0, 1, 0, 0, 0, 0); } } } // return 1; //I try comment & uncomment this, but still not works } return 1; // note that I try with 0 and 1 }