31.12.2014, 04:04
Boas eu queria que quando o player fizese o login desse logo spawn mas nao esta a funcionar
pawn Код:
public OnPlayerSpawn(playerid)
{
if(GetPlayerSkin(playerid) == 0)
{
if(PlayerInfo[playerid][skin] == 0)
{
PlayerInfo[playerid][skin] = 60;
SetPlayerSkin(playerid,PlayerInfo[playerid][skin]);
}
else SetPlayerSkin(playerid,PlayerInfo[playerid][skin]);
}
else
{
if(PlayerInfo[playerid][skin] == 0)
{
PlayerInfo[playerid][skin] = 60;
SetPlayerSkin(playerid,PlayerInfo[playerid][skin]);
}
else SetPlayerSkin(playerid,PlayerInfo[playerid][skin]);
}
if(PlayerInfo[playerid][x] == 0.0 && PlayerInfo[playerid][y] == 0.0 && PlayerInfo[playerid][z] == 0.0)
{
SetPlayerFacingAngle(playerid,270);
SetPlayerPos(playerid,-1961.2990,884.1435,42.1097);
}
else
{
SetPlayerPos(playerid,PlayerInfo[playerid][x],PlayerInfo[playerid][y],PlayerInfo[playerid][z]);
}
SetCameraBehindPlayer(playerid);
SetPlayerColor(playerid,COLOR_WHITE);
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
if(PlayerInfo[playerid][logged])return 1;
else
{
if(SpawnAttempts[playerid] >= MAX_SPAWN_ATTEMPTS)
{
KickPlayer(playerid,1001,"Tentar spawnar sem antes se registar/logar");
return 1;
}
SendClientMessage(playerid,COLOR_ERRO,"Tens que estar logado para poderes spawnar!");
SpawnAttempts[playerid] ++;
return 0;
}
}
case 1:
{
if(!response)
{
KickPlayer(playerid,1001,"Nгo quis logar");
return 1;
}
new string[258];
if(strlen(inputtext) < 4)
{
format(string, sizeof(string), "{FFFFFF}Bem-vindo de volta {00BFFF}%s{FFFFFF}!\n\nPara logares na tua conta, por favor insere a tua password\n",GetPlayerNameEx(playerid));
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", string, "Logar", "Sair");
return 1;
}
new arquivo[40];
format(arquivo,40,PASTA,GetPlayerOriginalName(playerid));
if(strcmp(inputtext,DOF2_GetString(arquivo,"password"),true))
{
format(string, sizeof(string), "{FFFFFF}Bem-vindo de volta {00BFFF}%s{FFFFFF}!\n\nPara logares na tua conta, por favor insere a tua password\n",GetPlayerNameEx(playerid));
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", string, "Logar", "Sair");
return 1;
}
LoadAccount(playerid);
PlayerInfo[playerid][logged] = true;
if(PlayerInfo[playerid][registado] == 1)
{
ShowPlayerDialog(playerid, DIALOG_SEXO, DIALOG_STYLE_LIST, "Escolha o sexo", "{FFFFFF}Masculino\nFeminino", "Continuar", "Sair");
return 1;
}
else if(PlayerInfo[playerid][registado] == 2)
{
ShowPlayerDialog(playerid, DIALOG_IDADE, DIALOG_STYLE_INPUT, "Escolha a idade", "{FFFFFF}Entre os 18 e os 65 anos\n", "Continuar", "Sair");
return 1;
}
else if(PlayerInfo[playerid][registado] == 3)
{
ShowPlayerDialog(playerid, DIALOG_SKIN, DIALOG_STYLE_INPUT, "Escolha a skin", "{FFFFFF}Entre os 1 e os 299\n", "Continuar", "Sair");
return 1;
}
SpawnPlayer(playerid);
}