Andr3 Posted April 26, 2011 Report Posted April 26, 2011 Acccount SystemV 1.1 FINALInformatii :Acest filterscript a fost creat cu ajutorul lui Y_Less care a facut y_ini,Roach pt. YDB si a lui Zex pt. Zcmd ! Cu acest script , banii si scorul jucatorilor se vor salva ! Last Release: Account System v.1.0Curent Release: Account System v. 1.1(switch to Zcmd & Y_INI )[glow=red,2,300]Data crearii[/glow] : 25.04.2011 - 27.04.2011/*------------------------------- Y_Less - y_ini --------------------------------- JoKeR - Script --------------------------------- www.sa-mp.ro - Tutorials www.sa-mp.com- Tutorials --------------------------------*/ #include <a_samp> #include < zcmd > #include < YDB > #include < YSI\y_ini > #define DIRECTORY "Accounts/%s.ini" //Colors// #define COLOR_SYSTEM (0xEFEFF7AA) #define green (0x33FF33AA) #define blue (0x00FFFFAA) forward Pass( playerid, name[ ], value[ ] ); forward LoadpUser( playerid, name[ ], value[ ] ); public OnFilterScriptInit( ) { print( "\n--------------------------------------" ); print( "Account System " ); print( "--------------------------------------\n" ); return ( 1 ); } public OnPlayerRequestSpawn( playerid ) { if( INI_Exist ( pName( playerid ) ) ) { if( GetPVarInt( playerid, "pLog" ) == 0 ) { SendClientMessage( playerid, green, "You have already registered, use /login to log into your account. "); return ( 0 ); } } return ( 1 ); } public OnPlayerDisconnect( playerid ) { if( GetPVarInt( playerid, "pLog" ) == 1 ) { new file[ 256 ]; format( file, sizeof file, DIRECTORY, pName( playerid ) ); new INI:PlayerAcc = INI_Open( file ); INI_WriteInt( PlayerAcc, "Money", GetPlayerMoney( playerid ) ); INI_WriteInt( PlayerAcc, "Score", GetPlayerScore( playerid ) ); INI_Close( PlayerAcc ); SetPVarInt( playerid, "pLog", 0 ); } return ( 1 ); } public OnPlayerConnect( playerid ) { if( GetPVarInt( playerid, "pLog" ) == 0 ) { if( INI_Exist ( pName( playerid ) ) ) { SystemMsg( playerid, "You have already registered, please /login [password] to login." ); } else SystemMsg( playerid, "You do not have an account, use /register [password] to register then /login [password] to login." ); } return ( 1 ); } stock SystemMsg( playerid, msg[ ] ) { if( ( IsPlayerConnected ( playerid ) ) && ( strlen ( msg ) > 0 ) ) SendClientMessage( playerid, COLOR_SYSTEM, msg ); return ( 1 ); } stock pName( playerid ) { new name[ MAX_PLAYER_NAME ]; GetPlayerName( playerid, name, sizeof name ); return name; } CMD:register( playerid, params[ ] ) { new file[ 256 ]; format( file, sizeof file, DIRECTORY, pName( playerid ) ); new INI:PlayerAcc = INI_Open( file ); if( GetPVarInt( playerid, "pLog" ) == 1 ) return SystemMsg( playerid, "You have already had an account." ); if( INI_Exist( pName( playerid ) ) ) return SystemMsg( playerid, "You have already created an account, /login [password] to login." ); if( strlen ( params ) == 0 ) return SystemMsg( playerid, "Usage: /register [password]" ); SystemMsg( playerid, "You have successfully created your account, now use /login [password] to login." ); INI_WriteString( PlayerAcc, "Name", pName( playerid ) ); INI_WriteString( PlayerAcc, "Password", params ); INI_WriteInt( PlayerAcc, "Money", 0 ); INI_WriteInt( PlayerAcc, "Score", 0 ); INI_Close( PlayerAcc ); return ( 1 ); } CMD:login( playerid, params[ ] ) { new file[ 256 ], Passw[ 500 ]; format( file, sizeof file, DIRECTORY, pName( playerid ) ); INI_ParseFile(file, "Pass", false, true, playerid); GetPVarString( playerid, "pPass", Passw, sizeof Passw ); if( GetPVarInt( playerid, "pLog" ) == 1 ) return SystemMsg( playerid, "You have already logined." ); if( !INI_Exist ( pName( playerid ) ) ) return SystemMsg( playerid, "You do not have an account, please /register [password]" ); if( isnull ( params ) ) return SystemMsg( playerid, "Usage: /login [password]" ); if( strcmp ( Passw, params, false ) == 0 ) { SetPlayerScore( playerid, GetPVarInt( playerid, "pScore" ) ); ResetPlayerMoney( playerid ); GivePlayerMoney( playerid, GetPVarInt( playerid, "pCash" ) ); SetPVarInt( playerid, "pLog", 1 ); SystemMsg( playerid, "You have successfully logined." ); }else SystemMsg( playerid, "Wrong password or nickname!" ); return ( 1 ); } public Pass( playerid, name[ ], value[ ] ) { if( !strcmp ( name, "Password" ) ) { SetPVarString( playerid, "pPass", value ); } } public LoadpUser( playerid, name[ ], value[ ] ) { if( !strcmp ( name, "Money" ) ) { SetPVarInt( playerid, "pCash", strval( value ) ); } if( !strcmp ( name, "Score" ) ) { SetPVarInt( playerid, "pScore", strval( value ) ); } } /*----------------------------------------- Thanks for use my Register & Login Script ------------------------------------------*/Amx.+Pwn./ScriptFiles/Include : DownloadDaca aveti probleme cu bug-urile lasa-ti un reply !Pentru a se salva banii si scorul creati un folder in scriptfiles (pentru cei care nu stiu ) Quote
xxSPEEDYxx Posted April 26, 2011 Report Posted April 26, 2011 destul de frumos GJ 5/5:Ddar daca vrei sa iti salvezi bani si score...exista si fs-ul saver...:D Quote Fara reclama in semnatura!
Guest RockStar Posted April 26, 2011 Report Posted April 26, 2011 Super , bravo dar era mai bine daca foloseai y_ini ;) Quote
XpLoD Posted April 27, 2011 Report Posted April 27, 2011 Foarte bun 5/5sunt multe sisteme de genu.. dar bne lucrat ;p Quote
Andr3 Posted April 27, 2011 Author Report Posted April 27, 2011 mersi , mersi !Deja lucrez la versiunea a 2-a ! Il trec in zcmd si YDB (include creat de Roach, cu niste chestii din y_ini ) Quote
florin Posted May 5, 2011 Report Posted May 5, 2011 pune 2 3 poze please! Quote wde [We Drift Everywhere] clan!
Andr3 Posted May 23, 2011 Author Report Posted May 23, 2011 Tu cred ca ai incurcat varza cu capra :| Pentru ce sa pun poze..pentru 2 dialoguri care-ti dai seama si singur cum arata ... Quote
4Warrior Posted July 14, 2011 Report Posted July 14, 2011 Daca nu va suparati imi puteti spune si mie cum il adaug , mie imi scrie in consola :" ERRROR: Could not connect to YSI update server <response was 006>. Quote
Ekso Posted July 14, 2011 Report Posted July 14, 2011 frumos! 5/5 Quote [glow=green,2,300]193.84.64.165:7777[/glow] [glow=blue,2,300]Romania[/glow] [glow=yellow,2,300]StunT[/glow][glow=red,2,300]ageS[/glow] 0.3a
Flyer-Satyr Posted July 15, 2011 Report Posted July 15, 2011 bunicel 3/5 ..app: data viitoare cand postezi coduri pawno , punele in Quote sau pe www.pastebin.com ;) Quote
Andr3 Posted July 15, 2011 Author Report Posted July 15, 2011 Cand am pus codul exista optiunea pawn , o sa modific acum Quote
Ryder_RO Posted September 11, 2011 Report Posted September 11, 2011 nu lucreaza de ce?nu se primeste de ce?BAH OMULE FARA 2x POST <> Se vede ca tot nu ai citit regulile !!Ce nu lucreaza ce nu primeste ? fi mai explicit !!Reported! Quote
PawnFox Posted September 12, 2011 Report Posted September 12, 2011 Daca nu va suparati imi puteti spune si mie cum il adaug , mie imi scrie in consola :" ERRROR: Could not connect to YSI update server <response was 006>.da , trebuie sa descarci ultima versiune YSI >> http://forum.sa-mp.com/showthread.php?p=884701Foarte frumos 5/5 :grin: Quote 94.23.120.101:7778
amircool Posted October 14, 2011 Report Posted October 14, 2011 Help where should i put the code??? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.