04.11.2012, 17:26
bootei um siistema de regiistro e logiin , aee quando digito a senha e aperto enter
so que da cash na msm hoora oolha aqui a miinha game mode
so que da cash na msm hoora oolha aqui a miinha game mode
Код:
// This is a comment // uncomment the line below if you want to write a filterscript //#define FILTERSCRIPT #include <a_samp> #include <SII> #define DIALOG_REGISTRO 2000 #define DIALOG_LOGAR 2001 #define BRANCO "{FFFFFF}" #define VERMELHO "{F81414}" #define VERDE "{00FF22}" #define AZUL CLARO "{00CED1}" new gPlayerName[MAX_PLAYERS][MAX_PLAYER_NAME]; enum pInfo { pSenha, pScore, pDinheiro, pAdmin } new PlayerInfo[MAX_PLAYERS][pInfo]; stock ObterINI(playerid) { new conta[64]; format(conta,30,"Contas/%s.ini",gPlayerName[playerid]); return conta; } #if defined FILTERSCRIPT public OnFilterScriptInit() { print("\n--------------------------------------"); print(" Brasil The Real"); print("--------------------------------------\n"); return 1; } public OnFilterScriptExit() { return 1; } #else main() { print("\n----------------------------------"); print("~r~ Serve Brasil The Real Iniciou"); print("----------------------------------\n"); } #endif public OnGameModeInit() { // Don't use these lines if it's a filterscript AddPlayerClass(522,1561.3455,-2263.8989,13.5476,92.8076,0,0,60000); AddPlayerClass(522,1560.4130,-2260.5330,13.5464,97.5077,6,6,60000); AddPlayerClass(522,1560.8723,-2257.3848,13.5470,94.6876,5,5,60000); AddPlayerClass(522,1561.9182,-2244.3120,13.5483,85.9141,20,21,60000); AddPlayerClass(522,1560.3510,-2238.3555,13.5469,99.3876,6,6,60000); SetGameModeText("Brasil The Real"); UsePlayerPedAnims(); AddPlayerClass(10, 1612.3243,-2273.2234,13.5168,8.8334, 0, 0, 0, 0, 0, 0); CreateVehicle(522,1563.0195,-2271.6021,13.5469,91.2408,0,6,60000); AddStaticPickup(1242,1,1563.0195,-2271.6021,13.5469,91.2408); SetTimer("Bem Vindo",60000,true); 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) { GetPlayerName(playerid, gPlayerName[playerid], MAX_PLAYER_NAME); if (fexist(ObterINI(playerid))) { ShowPlayerDialog(playerid, DIALOG_LOGAR, DIALOG_STYLE_INPUT,""BRANCO"Login",""BRANCO"Digite sua senha abaixo para efetuar login.","logar","Quit"); } else { ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_INPUT,""BRANCO"Registrando",""BRANCO"Digite sua senha abaixo para registrar uma nova conta.","Registrar","Quit"); } return 1; } public OnPlayerDisconnect(playerid, reason) { if(INI_Open(ObterINI(playerid))) { INI_WriteInt("Score",PlayerInfo[playerid][pScore]); INI_WriteInt("Dinheiro",GetPlayerMoney(playerid)); INI_WriteInt("Admin",PlayerInfo[playerid][pAdmin]); INI_Save(); INI_Close(); } return 1; } public OnPlayerSpawn(playerid) { return 1; } public OnPlayerDeath(playerid, killerid, reason) { SendClientMessage(playerid,-1,"Voce Foi Morto"); GameTextForPlayer(playerid,"Voce Morreu",3000,3); 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("/meucomando", cmdtext, true, 10) == 0) { GivePlayerMoney(playerid,10000); SetPlayerHealth(playerid,100); SetPlayerArmour(playerid,50); SendClientMessage(playerid,-1,"Voce Utilizou O /meucomando"); return 1; } return 0; } public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { GameTextForPlayer(playerid,"Voce Entrou Em Um Veiculo",3000,3); return 1; } public OnPlayerExitVehicle(playerid, vehicleid) { GameTextForPlayer(playerid,"Voce Saiu Do Veiculo",3000,3); 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 OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { switch( dialogid ) { case DIALOG_REGISTRO: { if (!response) return Kick(playerid); if (response) { if(!strlen(inputtext)) { ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_INPUT, ""BRANCO"Registrando...",""VERMELHO"Vocк digitou uma senha invбlida.\n"BRANCO"Digite sua senha abaixo para registrar uma nova conta.","Registro","Quit"); } if(INI_Open(ObterINI(playerid))) { INI_WriteString("Senha",inputtext); INI_WriteInt("Score",1); INI_WriteInt("Dinheiro",5000); INI_WriteInt("Admin",0); INI_Save(); INI_Close(); ShowPlayerDialog(playerid, DIALOG_LOGAR, DIALOG_STYLE_INPUT,""BRANCO"Logar",""BRANCO"Digite sua senha abaixo para efetuar login.","Logar","Quit"); } } } case DIALOG_LOGAR: { if ( !response ) return Kick ( playerid ); if( response ) { if(!strlen(inputtext)) { ShowPlayerDialog(playerid, DIALOG_LOGAR, DIALOG_STYLE_INPUT, ""BRANCO"Logar",""VERMELHO"Vocк digitou uma senha invбlida.\n"BRANCO"Digite sua senha abaixo para efetuar login.","Logar","Quit"); } if(INI_Open(ObterINI(playerid))) { INI_ReadString(PlayerInfo[playerid][pSenha],"Senha",20); if(strcmp(inputtext,PlayerInfo[playerid][pSenha],false)) { ShowPlayerDialog(playerid, DIALOG_LOGAR, DIALOG_STYLE_INPUT, ""BRANCO"Logar",""VERMELHO"Vocк digitou uma senha incorreta.\n"BRANCO"Digite sua senha abaixo para acessar.","Logar","Quit"); } SetPlayerScore( playerid, INI_ReadInt("Score" ) ); ResetPlayerMoney( playerid ); GivePlayerMoney( playerid, INI_ReadInt( "Dinheiro" ) ); PlayerInfo[playerid][pAdmin] = INI_ReadInt("Admin"); INI_Close(); } } } } return 1; } public OnPlayerClickPlayer(playerid, clickedplayerid, source) { return 1; }