PHP код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
#include <dini>
#define COR_MARFIM 0xF6F6B0AA
#define COR_VERDETAILANDES 0x00746EAA
#define COR_MENTA 0xB4F6F6AA
#define COR_MISTUREBA 0xB5A1BAAA
#define COR_SALMAO 0xD88DA3AA
#define COR_LILAS 0xC78DF6AA
#define COR_ROSABEBE 0xF6B6F6AA
#define COR_VERMELHOESCURO 0xDD0000FF
#define COR_LARANJA 0xFF9900AA
#define COR_ROSA 0xFF00FFAA
#define COR_VERDECLARO 0x7FFF00AA
#define COR_AZUL 0x63AFF00A
#define COR_PRETO 0x00000000
#define COR_VERMELHO 0xFF0000FF
#define COR_ROXO 0x800080AA
#define COR_AMARELO 0xFFFF00AA
#define COR_AZULCINZA 0x456EAF67
#define COR_AZULVERDE 0x46BBAA00
#define COR_AZULNEUTRO 0xABCDEF01
#define COR_CINZA 0xAFAFAFAA
#define COR_VERDE 0x0000FFAA
#define COR_VERMELHO2 0xAA3333AA
#define COR_AMARELO 0xFFFF00AA
#define COR_BRANCO 0xFFFFFFAA
#define COR_LARANJAVERMELHO 0xFF4500AA
#define COR_WEED1 0xFFE4B5FF
#define COR_WEED2 0x90EE90FF
#define COR_OURO 0xB8860BAA
#define COR_VIOLETA 0xEE82EEFF
new Logado[MAX_PLAYERS];
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Script");
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)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerConnect(playerid)
{
new log[35];
new regstring[130];
format(log,sizeof log,"CONTAS/%s.ini",Nome(playerid));
if(!dini_Exists(log))
{
SendClientMessage(playerid,0x00FF00FF,"Seja bem vindo pela primeira vez. Por favor digite uma senha para se registrar.");
format(regstring,sizeof(regstring),"{FFE4E1}%s, vocк ainda nгo possui uma conta em nosso banco de dados.\nPor favor digite uma senha para se registrar.",Nome(playerid));
ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"{87CEEB}Registrar",regstring,"Registrar","Sair");
return 1;
}
SendClientMessage(playerid,0x00FFFFFF,"Digite sua senha no diбlogo abaixo para poder logar.");
format(regstring,sizeof(regstring),"{FAF0E6}%s, vocк jб possui uma conta no banco de dados.\nDigite sua senha abaixo para poder logar.",Nome(playerid));
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"{F5F5F5}Logar",regstring,"Logar","Sair");
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
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("/mycommand", cmdtext, true, 10) == 0)
{
// Do something here
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)
{
if(Logado[playerid] == 0)
{
SendClientMessage(playerid,0xFFFF45,"Antes de Spawnar logue-se.");
return 0;
}
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 OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new arq[30];
format(arq,sizeof arq,"CONTAS/%s.ini",Nome(playerid));
if(dialogid == 1)
{
if(response == 1)
{
new regstring[130];
dini_Create(arq);
SendClientMessage(playerid,0xFFFF47,"Sua conta foi registrada com sucesso! Logue-se no diбlogo abaixo.");
format(regstring,sizeof(regstring),"{FAF0E6}Parabйns %s, vocк registrou sua conta.\nDigite sua senha abaixo para poder logar.",Nome(playerid));
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"{F5F5F5}Logar",regstring,"Logar","Sair");
dini_IntSet(arq,"Senha",strval(inputtext));
return 1;
}
SendClientMessage(playerid,0xFFFF00,"Vocк usou a opзгo 'Sair' e foi kickado pelo servidor!");
Kick(playerid);
}
else if(dialogid == 2)
{
if(response == 1)
{
if(dini_Int(arq,"Senha") == strval(inputtext))
{
//Aqui coloca-se as variбveis do texto, como Level, dinheiro,etc.
SendClientMessage(playerid,0xFFFF43,"Vocк logou no servidor com sucesso!");
Logado[playerid] = 1;
return 1;
}
SendClientMessage(playerid,0xFFFF88,"Vocк digitou a senha incorretamente. Digite-a novamente.");
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"{F5F5F5}Logar","Digite a senha corretamente.","Logar","Sair");
return 1;
}
SendClientMessage(playerid,0xFFFF00,"Vocк usou a opзгo 'Sair' e foi kickado pelo servidor!");
Kick(playerid);
}
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
stock Nome(playerid)
{
new nome[MAX_PLAYER_NAME];
GetPlayerName(playerid, nome, sizeof(nome));
return nome;
}