15.01.2012, 01:07
Bom galera, to fazendo um gm do zero peguei uma fs de registro e acoplei no gm, mas depois que o player loga ele precisa apertar spawn para poder ir para o rc...
Ja testei a fs sem tar dentro do gm. Se alguem puder me ajudar a resolver eu agradeзo.
Ja testei a fs sem tar dentro do gm. Se alguem puder me ajudar a resolver eu agradeзo.
PHP код:
#include <a_samp>
#include <Dini>
//================== DEFINES =========================
#define REGISTRO 1
#define LOGIN 2
#define CONTAS "Contas/%s.ini"
//================= NEWS ==============================
new Matou[MAX_PLAYERS];
new Morreu[MAX_PLAYERS];
new Logou[MAX_PLAYERS];
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" BRASIL 50 CENT");
print("--------------------------------------\n");
return 1;
}
main()
{
print("\n----------------------------------");
print(" BRASIL 50 CENT");
print("----------------------------------\n");
}
public OnGameModeInit()
{
SetGameModeText("BRASIL 50 CENT");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
return 1;
}
public OnPlayerConnect(playerid)
{
new Nome[MAX_PLAYER_NAME];
GetPlayerName(playerid, Nome, sizeof(Nome));
new String[100];
format(String, sizeof(String), CONTAS, Nome);
if(!dini_Exists(String))
{
format(String, sizeof(String), "{7FFFD4}Nick: {1E90FF}%s {1E90FF}Nгo Registrado\n\n{FFFFFF} Digite Uma Senha Para Continuar", Nome);
ShowPlayerDialog(playerid, REGISTRO, DIALOG_STYLE_INPUT, "Registro", String, "Registrar", "Cancelar");
}
else
{
format(String, sizeof(String), "{7FFFD4}Nick: {1E90FF}%s {1E90FF}Registrado\n\n{FFFFFF} Digite Sua Senha Para Logar", Nome);
ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT, "Registro", String, "Logar", "Cancelar");
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
SalvarPlayer(playerid);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(IsPlayerConnected(killerid))
{
Matou[killerid]++;
}
Morreu[playerid]++;
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/status", cmdtext, true, 8) == 0)
{
Status(playerid);
return 1;
}
return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
return 1;
}
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}
public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}
public OnPlayerUpdate(playerid)
{
return 1;
}
public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}
public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}
public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == REGISTRO)
{
if(response)
{
if(!strlen(inputtext))
{
new Nome[MAX_PLAYER_NAME];
GetPlayerName(playerid, Nome, sizeof(Nome));
new String[100];
format(String, sizeof(String), "{7FFFD4}Nick: {1E90FF}%s {1E90FF}Nгo Registrado\n\n{FFFFFF} Digite Uma Senha Para Continuar", Nome);
ShowPlayerDialog(playerid, REGISTRO, DIALOG_STYLE_INPUT, "Registro", String, "Registrar", "Cancelar");
SendClientMessage(playerid,0x1E90FFAA,"Senha invalida, digite uma senha vбlida");
return 1;
}
new Nome[MAX_PLAYER_NAME];
GetPlayerName(playerid, Nome, sizeof(Nome));
new String[100];
format(String, sizeof(String), CONTAS, Nome);
dini_Create(String);
dini_Set(String,"Senha",inputtext);
dini_IntSet(String,"Dinheiro",0);
dini_IntSet(String,"Vida", 100);
dini_IntSet(String,"Colete", 100);
dini_IntSet(String,"Matou",0);
dini_IntSet(String,"Morreu",0);
dini_IntSet(String,"Logou",0);
ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT, "Login", "{1E90FF}Pronto vocк se registrou agora digite Sua Senha Para Logar-Se", "Logar", "Cancelar");
return 1;
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Vocк Foi Kickado Porque Nгo Quis Se Registrar!!");
Kick(playerid);
return 1;
}
}
if(dialogid == LOGIN)
{
if(response)
{
if(!strlen(inputtext))
{
new Nome[MAX_PLAYER_NAME];
GetPlayerName(playerid, Nome, sizeof(Nome));
new String[100];
format(String, sizeof(String), "{7FFFD4}Nick: {1E90FF}%s {1E90FF}Registrado\n\n{FFFFFF} Digite Sua Senha Para Logar", Nome);
ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT, "Registro", String, "Logar", "Cancelar");
SendClientMessage(playerid,0x1E90FFAA,"Senha Incorreta !");
return 1;
}
new Nome[MAX_PLAYER_NAME];
GetPlayerName(playerid, Nome, sizeof(Nome));
new String[100];
format(String, sizeof(String), CONTAS, Nome);
if(!strcmp(inputtext,dini_Get(String,"Senha"),false))
{
SetarPlayer(playerid);
Logou[playerid]++;
SendClientMessage(playerid,0x00FF00AA,"Vocк Foi Logado Com Sucesso > Escolha Sua Skin!");
return 1;
}
else
{
SendClientMessage(playerid,0x00FF00AA,"Senha incorreta digite-a novamente");
format(String, sizeof(String), "{7FFFD4}Nick: {1E90FF}%s {1E90FF}Registrado\n\n{FFFFFF} Digite Sua Senha Para Logar", Nome);
ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT, "Registro", String, "Logar", "Cancelar");
}
return 1;
}
else
{
SendClientMessage(playerid, 0xFF0000AA, "Vocк nгo quis se logar, por este motivo serб Kickado");
Kick(playerid);
return 1;
}
}
return 1;
}
SalvarPlayer(playerid)
{
new Float:Vida;
new Float:Colete;
GetPlayerHealth(playerid, Vida);
GetPlayerArmour(playerid, Colete);
new Nome[MAX_PLAYER_NAME];
GetPlayerName(playerid, Nome, sizeof(Nome));
new String[50];
format(String, sizeof(String), CONTAS, Nome);
dini_IntSet(String,"Dinheiro", GetPlayerMoney(playerid));
dini_FloatSet(String,"Vida", Vida);
dini_FloatSet(String,"Colete", Colete);
dini_IntSet(String,"Matou", Matou[playerid]);
dini_IntSet(String,"Morreu", Morreu[playerid]);
dini_IntSet(String,"Logou", Logou[playerid]);
return 1;
}
SetarPlayer(playerid)
{
SendClientMessage(playerid, 0xFF0000AA, "================================================");
new Nome[MAX_PLAYER_NAME];
GetPlayerName(playerid, Nome, sizeof(Nome));
new String[50];
format(String, sizeof(String), CONTAS, Nome);
GivePlayerMoney(playerid, dini_Int(String,"Dinheiro"));
SetPlayerHealth(playerid, dini_Int(String,"Vida"));
SetPlayerArmour(playerid, dini_Int(String,"Colete"));
Matou[playerid] = dini_Int(String, "Matou");
Morreu[playerid] = dini_Int(String, "Morreu");
Logou[playerid] = dini_Int(String, "Logou");
SendClientMessage(playerid, 0xFF0000AA, "================================================");
return 1;
}
Status(playerid)
{
new Nome[MAX_PLAYER_NAME];
GetPlayerName(playerid, Nome, sizeof(Nome));
new String[128];
format(String, sizeof(String),"Status De %s",Nome);
SendClientMessage(playerid, 0xFFFF00AA,String);
format(String, sizeof(String),"Dinheiro: %d", GetPlayerMoney(playerid));
SendClientMessage(playerid, 0x1E90FFAA,String);
format(String, sizeof(String),"Matou: %d",Matou[playerid]);
SendClientMessage(playerid, 0x1E90FFAA,String);
format(String, sizeof(String),"Morreu: %d",Morreu[playerid]);
SendClientMessage(playerid, 0x1E90FFAA,String);
format(String, sizeof(String),"Vocк Jб Logou %d Vezes Neste Servidor",Logou[playerid]);
SendClientMessage(playerid, 0x1E90FFAA,String);
return 1;
}