08.07.2014, 04:18
This should work:
pawn Код:
public OnPlayerSpawn(playerid)
{
new Random = random(sizeof(RandomSpawns));
SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
SetPlayerFacingAngle(playerid, RandomSpawns[Random][3]);
SetPlayerAttachedObject(playerid, 3, 1609, 2); //Attach a turtle to the playerid's head, in slot 3
// example of using colors on an object being attached to the player:
SetPlayerAttachedObject(playerid, 3, 19487, 2, 0.101, -0.0, 0.0, 5.50, 84.60, 83.7, 1, 1, 1, 0xFF00FF00);
PlayerInfo[playerid][SpawnDance] = true; //to not execute to much timers
KillTimer( PlayerInfo[playerid][SpawnTimer] ); //to kill it, since its useless now
PlayerPlaySound(playerid, 1186, 0.0, 0.0, 0.0); // (blank sound) to shut the music up
SetCameraBehindPlayer(playerid); //to prevent some bugs
new houseid = Player[playerid][Houseid];
if(Player[playerid][Spawn] == 1 && houseid != 999)
{
SetPlayerPos(playerid,Player[playerid][SpawnX],Player[playerid][SpawnY],Player[playerid][SpawnZ]);
SetPlayerInterior(playerid,Player[playerid][SpawnInt]);
SetPlayerVirtualWorld(playerid,Player[playerid][SpawnVW]);
}
return 1;
}