06.02.2014, 11:58
As I might suspect, you might be calling three functions too fast. I had this problem too.
Attempt to create a timer to re-skin the NPC. (Don't forget to reset player into the vehicle, unless you want the gameserver to crash.. Or, the players just..)
Attempt to create a timer to re-skin the NPC. (Don't forget to reset player into the vehicle, unless you want the gameserver to crash.. Or, the players just..)
pawn Код:
forward NPC_ResetSkin(npcid);
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid))
{
new npcname[24];
GetPlayerName(playerid, npcname, 24);
if(!strcmp(npcname, "Unity_Driver", true))
{
SetPlayerSkin(playerid, 150); // I'd suggest to move this code to the new function
PutPlayerInVehicle(playerid, Autobus_BusUnitySf, 0); // I'd suggest to move this code to the new function
Attach3DTextLabelToPlayer(Text3d_BusUnitySf, playerid, 0.0, 0.0, 0.0); // I'd suggest to move this code to the new function
SetTimerEx("NPC_ResetSkin", 1000, false, "d", playerid);
}
}
return 1;
}
public NPC_ResetSkin(npcid)
{
// your code here.
}