PHP код:
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid))
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname));
//if(!strcmp(npcname, "Belck", true))
if(!strcmp(npcname, "Belck"))
{
SetPlayerSkin(playerid,281);
Attach3DTextLabelToPlayer(Belck, playerid, 0.0, 0.0, 0.2);
SetPlayerColor(playerid,0xFFFFFF00);
SetPlayerVirtualWorld(playerid, 0);// seta o mundo virtual
SetPlayerInterior(playerid, 0);// seta o interior
SetTimerEx("FalaDeBelck",20000,true,"d",playerid);
}
return 1;
}
// teste esse comando
CMD:irnpc(playerid, params[])
{
new id = strval(params);
if(IsPlayerNPC(id))
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(id, x, y, z);
SetPlayerInterior(playerid, GetPlayerInterior(id));
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
new npcname[MAX_PLAYER_NAME], str[128];
GetPlayerName(id, npcname, MAX_PLAYER_NAME);
format(str, sizeof(str), "Vocк foi atй o npc %s", npcname);
SendClientMessage(playerid, -1, str);
return true;
}
SendClientMessage(playerid, -1, "nгo й um npc");
return true;
}