SA-MP Forums Archive
Offline transfer method, need help, offer rep ++:D - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Offline transfer method, need help, offer rep ++:D (/showthread.php?tid=297335)



Offline transfer method, need help, offer rep ++:D - Edvin - 15.11.2011

Hi,
I try to do a comanda that you can transfer your money into an another account if it exists. I make this in dialogs. But here is the problem, when i type the PlayerName, where i want to transfer my moneys, the dialog don't make any move. I type the PlayerName and dialog dissapear and don't do anything.

Here is my dialog( It's just dialog response ):
Код:
if ( dialogid == MoveStats6 )
	{
		if ( !response ) return 1;
		if ( sscanf( inputtext, "s[128]", inputtext[ 0 ] ) ) return ShowPlayerDialog( playerid, MoveStats6, DIALOG_STYLE_INPUT, "Move Stats", "{E60000}ERROR: {ACACAC}Trebuie sa scrii numele player-ului caruia vrei sa-i transferi statisticile!\n\n{ACACAC}Acum scrie {E60000}numele jucatorului{ACACAC}, caruia vrei sa-i transferi statisticile( Bani )!", "Transfera", "Iesire" );
	    if ( IsPlayerConnected( inputtext[ 0 ] ) ) return ShowPlayerDialog( playerid, MoveStats6, DIALOG_STYLE_INPUT, "Move Stats", "{E60000}ERROR: {ACACAC}Playerul trebuie sa fie deconectat ca sa ii poti transfera banii!\n\n{ACACAC}Acum scrie {E60000}numele jucatorului{ACACAC}, caruia vrei sa-i transferi statisticile( Bani )!", "Transfera", "Iesire" );
	    if ( inputtext[ 0 ] == playerid ) return ShowPlayerDialog( playerid, MoveStats6, DIALOG_STYLE_INPUT, "Move Stats", "{E60000}ERROR: {ACACAC}Nu poti sa-ti transfer tie banii!\n\n{ACACAC}Acum scrie {E60000}numele jucatorului{ACACAC}, caruia vrei sa-i transferi statisticile( Bani )!", "Transfera", "Iesire" );
		if ( GetPlayerMoney( playerid ) == 0 ) return SendClientMessage( playerid, COLOR_ULTRARED, "ERROR: Ai 0 bani, deci nu poti transfera banii! {ACACAC}Actiune Intrerupta!" );

		new pMoney = GetPlayerMoney( playerid );
		new file[ 128 ], str[ 256 ];
		format( file, 128, "/ladmin/users/%s.sav", inputtext[ 0 ] );
		if ( !udb_Exists( inputtext[ 0 ] ) )
		{
		    format( str, sizeof( str ), "{E60000}ERROR: {ACACAC}Accountul cu numele %s nu exista!\n\n{ACACAC}Acum scrie {E60000}numele jucatorului{ACACAC}, caruia vrei sa-i transferi statisticile( Bani )!", inputtext );
	 		return ShowPlayerDialog( playerid, MoveStats6, DIALOG_STYLE_INPUT, "Move Stats", str, "Transfera", "Iesire" );
		}
		else
		{
		    ResetPlayerMoney( playerid );
			GivePlayerMoney( inputtext[ 0 ], pMoney );
			format( str, sizeof( str ), "SUCCES: {ACACAC}Ti-ai mutat toti bani pe numele %s", inputtext[ 0 ] );
			SendClientMessage( playerid, COLOR_GREEN, str );
		}
	}
?


Re: Offline transfer method, need help, offer rep ++:D - KosmasRego - 15.11.2011

While the player is offline?


Re: Offline transfer method, need help, offer rep ++:D - Edvin - 15.11.2011

Yes, player must be offline to work this transfer!


Re: Offline transfer method, need help, offer rep ++:D - KosmasRego - 15.11.2011

Try contacting a good scripter...He may ask for a payament but he will make it work. I suggest you Calgon


Re: Offline transfer method, need help, offer rep ++:D - Edvin - 15.11.2011

I post here because i know scripting( Not perfectlly ) and i just need to resolve this problem. Not to do all script, and pay for it.


Re: Offline transfer method, need help, offer rep ++:D - admantis - 15.11.2011

This is easy to make however what system you use to save files ? and what's called the line / field / variable in the file where the money is stored?


Re: Offline transfer method, need help, offer rep ++:D - Edvin - 15.11.2011

I use LAdmin, but is edited by me...

The line what save money in %s.sav is called: "Moneys"


Re: Offline transfer method, need help, offer rep ++:D - Edvin - 15.11.2011

BUMP UP!


Re: Offline transfer method, need help, offer rep ++:D - Tigerkiller - 15.11.2011

which file system are you using


Re: Offline transfer method, need help, offer rep ++:D - Edvin - 15.11.2011

Dini, lethaldudb functions for LAdmin xD