Oh, sorry, here:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
switch(PlayerInfo[playerid][pSpawn])
{
case 0: //DEFAULT SPAWN
{
new RandSpawn = random(sizeof(gRandomSpawns));
SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], gRandomSpawns[RandSpawn][0], gRandomSpawns[RandSpawn][1], gRandomSpawns[RandSpawn][2], gRandomSpawns[RandSpawn][3], 0, 0, 0, 0, 0, 0);
}
case 1: //HOUSE SPAWN,
{
if(PlayerInfo[playerid][pHouse] > -1 && !strcmp(HouseInfo[PlayerInfo[playerid][pHouse]][hOwner], GetName(playerid)))
{
SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], HouseInfo[PlayerInfo[playerid][pHouse]][hExitx], HouseInfo[PlayerInfo[playerid][pHouse]][hExity], HouseInfo[PlayerInfo[playerid][pHouse]][hExitz], HouseInfo[PlayerInfo[playerid][pHouse]][hExita], 0, 0, 0, 0, 0, 0);
}
else // IF HOUSE SPAWN ENABLED BUT PLAYER HAS NO HOUSE
{
PlayerInfo[playerid][pSpawn] = 0;
new RandSpawn = random(sizeof(gRandomSpawns));
SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], gRandomSpawns[RandSpawn][0], gRandomSpawns[RandSpawn][1], gRandomSpawns[RandSpawn][2], gRandomSpawns[RandSpawn][3], 0, 0, 0, 0, 0, 0);
}
}
//case 2: //
}
return 1;
}
pawn Код:
public OnPlayerSpawn(playerid)
{
switch(PlayerInfo[playerid][pSpawn])
{
case 1:
{
if(PlayerInfo[playerid][pHouse] > -1 && !strcmp(HouseInfo[PlayerInfo[playerid][pHouse]][hOwner], GetName(playerid)))
{
SetPlayerInterior(playerid, HouseInfo[PlayerInfo[playerid][pHouse]][hInterior]);
SetPlayerVirtualWorld(playerid, HouseInfo[PlayerInfo[playerid][pHouse]][hVirtualWorld]);
InsideHouse[playerid] = PlayerInfo[playerid][pHouse];
}
}
}
SetPlayerColor(playerid, 0xFFFFFFFF);
SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
SetCameraBehindPlayer(playerid);
if(LoggedIn[playerid] == 0)
{
SendClientMessage(playerid, -1, "Spawn is not allowed before you log in.");
Kick(playerid);
}
if(GetPlayerMoney(playerid)!=SafeGetPlayerMoney(playerid))
{
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, SafeGetPlayerMoney(playerid));
}
return 1;
}