Help with "FADMIN" | How can i measure the Axis if i want to attach a object to a vehicle or player? -
ZayanImran - 24.01.2013
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
Код:
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.
Re: Help with "FADMIN" | How can i measure the Axis if i want to attach a object to a vehicle or player? -
ZayanImran - 24.01.2013
plz reply fast!!
Re: Help with "FADMIN" | How can i measure the Axis if i want to attach a object to a vehicle or player? -
SomeRandomGuy123 - 24.01.2013
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).
Код:
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.