SA-MP Forums

Go Back   SA-MP Forums > SA-MP Server > Server Support

Reply
 
Thread Tools Display Modes
Old 24/01/2013, 04:56 PM   #1
ZayanImran
Big Clucker
 
Join Date: Dec 2012
Location: Somewhere, beyond the sea.
Posts: 63
Reputation: -1
Question Help with "FADMIN" | How can i measure the Axis if i want to attach a object to a vehicle or player?

Hello, I found some problem in fAdmin, when i connect to the server with a different name, it should show me the register dialog but it shows me the login dialog, here is the code to login\register

Code:
public OnPlayerRequestClass(playerid, classid)
{
    new name[MAX_PLAYER_NAME];
	GetPlayerName(playerid,name,sizeof(name));
	format(File,sizeof(File),"/fAdmin/Players/%s.txt",name);
	if(!dini_Exists(File))
	{
	if(PlayerLogged[playerid] == 0)
    {
	    if(PlayerAcc[playerid][Registered] == 0)
		{
			#if MustRegister == true
			new Name[MAX_PLAYER_NAME];
			GetPlayerName(playerid,Name,sizeof(Name));
			new rstring[256];
			format(rstring,256,"Welcome to the server!\nYour account (%s) isnt registered!\n\nPlease type your password:",Name);
			ShowPlayerDialog(playerid,RegisterDialog,DIALOG_STYLE_PASSWORD,"Register Account",rstring,"Register","Quit");
			#endif
			return 1;
		}
	}
	return 1;
	}
 	if(PlayerAcc[playerid][Registered] == 1)
	{
			#if MustLogin == true
			new Name[MAX_PLAYER_NAME];
			GetPlayerName(playerid,Name,sizeof(Name));
			new lstring[256];
			format(lstring,256,"Your account (%s) is registered!\n\nLogin to access your account:",Name);
			ShowPlayerDialog(playerid,LoginDialog,DIALOG_STYLE_PASSWORD,"Account Login",lstring,"Login","Quit");
			#endif
            return 1;
	}
	return 1;
}
If you find any mistake, pleas fix that code and give it to me here on this page
__________________________________________________ ____________________________________

The second prob is that if i want to attach a abject with a vehicle or a player, how will i measure the axis, it is very hard for me cant think, please help me with that.

and

how will i make /stealth which will hide the player name and his dot on the map something like spy shit.
ZayanImran is offline   Reply With Quote
Old 24/01/2013, 07:03 PM   #2
ZayanImran
Big Clucker
 
Join Date: Dec 2012
Location: Somewhere, beyond the sea.
Posts: 63
Reputation: -1
Default Re: Help with "FADMIN" | How can i measure the Axis if i want to attach a object to a vehicle or player?

plz reply fast!!
ZayanImran is offline   Reply With Quote
Old 24/01/2013, 07:38 PM   #3
SomeRandomGuy123
Little Clucker
 
Join Date: Sep 2009
Posts: 31
Reputation: 0
Default Re: Help with "FADMIN" | How can i measure the Axis if i want to attach a object to a vehicle or player?

Found an error with it, i've re-coded it. It should work, if it doesn't tell me.
I'm not sure why you have #endif there? If it doesn't work, I suggest removing it unless you require it.
Also, I changed format(file, sizeof(file),"/fAdmin/Players/%s.txt",name); to format(file, sizeof(file),"/fAdmin/Players/%s.ini",name); (.ini file instead of .txt).

Code:
public OnPlayerRequestClass(playerid, classid)
{
    new name[MAX_PLAYER_NAME], file[64];
	GetPlayerName(playerid,name,sizeof(name));
	format(file, sizeof(file),"/fAdmin/Players/%s.ini",name);
	{
	if(PlayerLogged[playerid] == 0)
    {
	    if(!dini_Exists(file))
		{
			#if MustRegister == true
			new Name[MAX_PLAYER_NAME];
			GetPlayerName(playerid,Name,sizeof(Name));
			new rstring[256];
			format(rstring,256,"Welcome to the server!\nYour account (%s) isnt registered!\n\nPlease type your password:",Name);
			ShowPlayerDialog(playerid,RegisterDialog,DIALOG_STYLE_PASSWORD,"Register Account",rstring,"Register","Quit");
			#endif
			return 1;
		}
   }
	}
	else
	{
			#if MustLogin == true
			new Name[MAX_PLAYER_NAME];
			GetPlayerName(playerid,Name,sizeof(Name));
			new lstring[256];
			format(lstring,256,"Your account (%s) is registered!\n\nLogin to access your account:",Name);
			ShowPlayerDialog(playerid,LoginDialog,DIALOG_STYLE_PASSWORD,"Account Login",lstring,"Login","Quit");
			#endif
            return 1;
	}
	return 1;
}
Edit: Also to get the axis / coordinates of an object, I suggest using the "Attachments" filterscript which comes default with the SAMP server files. When you place an object onto your player, it shows you the co-ordinates of which you placed it etc.
SomeRandomGuy123 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Vehicle Storage" & "Neon System" Illusion_gamers Scripting Help 1 01/10/2012 04:55 PM
[Include] "OnPlayerLookAtVehicle" - Detect if a player is looking at some vehicle. iPLEOMAX Includes 46 28/01/2012 06:09 PM
"Slight homing", make a missile "Slightly!" home a vehicle. Donya Help Archive 4 11/06/2011 09:20 PM
Is player talks, use OnePlayAnim(playerid,"PED","IDLE_CHAT",4.0,0,0,0,0,0); Ihsan_Cingisiz Help Archive 5 30/05/2010 03:26 PM
Is player in range of "OBJECT"?? Faith Help Archive 2 13/05/2010 08:55 PM


All times are GMT. The time now is 04:29 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.