PHP код:
public OnPlayerSpawn(playerid)
{
new model = SetPlayerSkin(playerid, PlayerInfo[playerid][Skin]);
SetSpawnInfo(playerid, 0, model,0.0,0.0,0.0,0,0,0,0,0,0,0);
if(PlayerInfo[playerid][Tutorial] == 0)
{
new string[128];
PlayAudioStreamForPlayer(playerid, "http://dl.dropboxusercontent.com/s/yyzscx296xlxbe7/tutorial.mp3");
TogglePlayerControllable(playerid, 0);
SetPlayerPos(playerid, 1727.0171,-1635.5856,20.2167);
SetPlayerCameraPos(playerid, 1500.33,-890.29,64.47);
SetPlayerCameraLookAt(playerid, 1464.20,-855.87,67.68);
new Registro[256];
format(string, sizeof(string), "{FFFFFF}Olб {00C3FF}%s{FFFFFF}, agora vocк estб registrado no servidor\n",PlayerName(playerid));
strcat(Registro,string);
strcat(Registro,"{FFFFFF}Jб falta pouco para vocк poder jogar mas para isso falta algumas informaзхes\n");
strcat(Registro,"{FFFFFF}Escolha o seu sexo por favor:\n");
ShowPlayerDialog(playerid, 999, DIALOG_STYLE_MSGBOX,"{EEEEEE}Registro - Sexo",Registro,"Homem","Mulher");
}
//============================ TELA DE LOGIN PROVISORIA =====//
TextDrawHideForPlayer(playerid, TDLogin);
TextDrawHideForPlayer(playerid, TDLogin2);
//============================= SISTEMA DE FOME E SEDE - APARECE AO SPAWNA ==========//
SetPVarInt(playerid,"Fome",0);
ShowProgressBarForPlayer(playerid, FomeA);
SetPVarInt(playerid,"Sede",0);
ShowProgressBarForPlayer(playerid, SedeB);
TextDrawShowForPlayer(playerid, FomeT);
TextDrawShowForPlayer(playerid, SedeT);
SetTimerEx("Fome",FomeTempo*120000 , 1, "i", playerid);
SetTimerEx("Sede",SedeTempo*120000 , 1, "i", playerid);
return 1;
}
PHP код:
public OnPlayerDeath(playerid, killerid, reason)
{
new model = SetPlayerSkin(playerid, PlayerInfo[playerid][Skin]);
SetSpawnInfo(playerid, 0, model,0.0,0.0,0.0,0,0,0,0,0,0,0);
SpawnPlayer(playerid);
//=============================//
PlayerInfo[playerid][Morreu] ++;
PlayerInfo[playerid][Matou] ++;
SendDeathMessage(killerid, playerid, reason);
//=============================//
SetProgressBarValue(FomeA,0);
UpdateProgressBar(FomeA,playerid);
SetPVarInt(playerid,"Fome",0);
SetProgressBarValue(SedeB,0);
UpdateProgressBar(SedeB,playerid);
SetPVarInt(playerid,"Sede",0);
//============================//
return 1;
}