29.01.2015, 23:05
pawn Код:
public OnPlayerSpawn(playerid)
{
TextDrawShowForPlayer(playerid,Time);
TextDrawShowForPlayer(playerid,Date);
new tmp[64], skin;
cache_get_field_content(0, "skin", tmp);
skin = strval(tmp);
new name[MAX_PLAYER_NAME];
new voltarcoordenada[256];
GetPlayerName(playerid, name, sizeof(name));
format(voltarcoordenada, sizeof(voltarcoordenada), "%s.spawn.ini", name);
if(fexist(voltarcoordenada) && SpawnBloqueado[playerid] == 0)
{
X[playerid] = dini_Float(voltarcoordenada,"CoordenadaX");
Y[playerid] = dini_Float(voltarcoordenada,"CoordenadaY");
Z[playerid] = dini_Float(voltarcoordenada,"CoordenadaZ");
A[playerid] = dini_Float(voltarcoordenada,"CoordenadaA");
SetSpawnInfo(playerid, 0, skin, X[playerid], Y[playerid], Z[playerid], 0, 0, 0, 0, 0, 0, 0);
SetPlayerFacingAngle(playerid, A[playerid]);
SetCameraBehindPlayer(playerid);
SendClientMessage(playerid, 0x33FF00FF, "Vocк voltou para onde saiu pela ъltima vez.");
SpawnBloqueado[playerid] = 1;
}
if(!fexist(voltarcoordenada))
{
dini_Create(voltarcoordenada);
SpawnBloqueado[playerid] = 1;
}
return 1;
}
pawn Код:
for(new i; i < MAX_PLAYERS; i ++)
{
if(IsPlayerConnected(i))
{
TextDrawShowForPlayer(i, Textdrawdebaixodoradar);
}
}
e isto:
pawn Код:
stock SetSkin(playerid, skin)
{
SetSpawnInfo(playerid, 0, skin, 1958.3783, 1343.1572, 15.3746, 0, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
// Salvando dados do jogador
saveAll();
return SetPlayerSkin(playerid, skin);
}