Login Script - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Login Script (
/showthread.php?tid=151321)
Login Script -
Cameltoe - 30.05.2010
Hello and good night everyone!
today I downloaded a bunch of gamemodes to get to know where to start.
im pretty new to pawn, but have some knowledge in other languages.
in a gamemode called LSL:RP i found a pretty cool login function:
[img width=960 height=768]http://i50.tinypic.com/s0zyfa.png[/img]
Could someone describe to me how thats done? or at least put me in the right direction?
Also
i want to know if its possible to use an other form for money without mysql (flatfiles)?
i want my own cash on my server cause i find the regular cash in game pretty bugged, and most anticheats have walk arounds for money
Thx !
Re: Login Script -
coole210 - 30.05.2010
Server-sided cash
Top of script:
Код:
new Cash[MAX_PLAYERS];
Bottom of script:
Код:
stock GetPlayerCash(playerid)
{
return Cash[playerid]
}
stock GivePlayerCash(playerid,cash)
{
Cash[playerid] = Cash[playerid] + cash;
return Cash[playerid];
}
stock ResetPlayerCash(playerid)
{
Cash[playerid] = 0;
return Cash[playerid];
}
Login/Register
OnPlayerConnect:
Код:
new string[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string),"/Accounts/%s.ini",name);
if(fexist(string))
{
ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Login","Welcome!\nPlease login","Login","Exit");
}
if(!fexist(string))
{
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"Register","Welcome!\nPlease register","Register","Exit");
}
Under #include <a_samp>:
You figure out the rest. Good luck on your very new server.
Off topic: You play Spring-Vale? Cuz you're name is Camel there and i see "Camel" in game right now and you're asking questions about the features spring-vale has so i'm just connecting the dots..
Re: Login Script -
GangsTa_ - 30.05.2010
It doesnt works good.
The [MAX_PLAYERS] is undefined symbol
And also when you join the server it requests only register
You should make OnDialogResponse
Re: Login Script -
Antonio [G-RP] - 30.05.2010
Will the file and fexist work for all login/register systems?
Re: Login Script -
Grim_ - 30.05.2010
Quote:
Originally Posted by Antonio (eternalrp.webatu.com)
Will the file and fexist work for all login/register systems?
|
What do you mean?
fexist(file[]) just checks if the file (file[]) exists.
It's not specific to certain register/login systems.
Re: Login Script -
Antonio [G-RP] - 30.05.2010
Just checks if the file exists ?
Re: Login Script -
Grim_ - 30.05.2010
Quote:
Originally Posted by Antonio (eternalrp.webatu.com)
Just checks if the file exists ?
|
Yes, that's all the function does.
https://sampwiki.blast.hk/wiki/fexist
Re: Login Script -
Antonio [G-RP] - 30.05.2010
Alright thanks
Re: Login Script -
Cameltoe - 30.05.2010
Thx ill try it out! and yes ^^ i play SV Camel[Toe] -> [Toe] clan x) Sv ftw ^^
Re: Login Script -
Cameltoe - 30.05.2010
Quote:
Originally Posted by Coole[AG
]
You figure out the rest. Good luck on your very new server.
|
Works flawless, ill get to the figure out the rest part now