You cannot spawn without Login or register Command! - 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: You cannot spawn without Login or register Command! (
/showthread.php?tid=87271)
You cannot spawn without Login or register Command! -
clean180ollie - 19.07.2009
Whats the command for that? It happens on onplayerspawn.
This is my DCMD login code,
Код:
dcmd_register(playerid, params[])
{
new file[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "Users\%s.ini", pname);
if(!strlen(params)) return SendClientMessage(playerid, COLOR_RED, "USAGE:/register [password]");
if(dini_Exists(file)) return SendClientMessage(playerid, COLOR_RED, "You are already registered!");
dini_Create(file);
dini_IntSet(file, "hashPW", udb_hash(params));
dini_Set(file, "password", params);
dini_IntSet(file, "level", 0);
dini_IntSet(file, "score", GetPlayerScore(playerid));
dini_IntSet(file, "money", GetPlayerMoney(playerid));
dini_IntSet(file, "PlayerLogged", IsPlayerConnected(playerid));
new string[256];
format(string, 256, "You succesfully registered the nickname %s with password %s", pname, params);
SendClientMessage(playerid, COLOR_YELLOW, string);
logged[playerid] = 1;
SendClientMessage(playerid, COLOR_YELLOW, "You have been automatically logged in!");
return 1;
}
dcmd_login(playerid, params[])
{
new file[256];
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), "Users\%s.ini", pname);
if(!strlen(params)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /login [password]");
if(!dini_Exists(file)) return SendClientMessage(playerid, COLOR_RED, "You are not registered!");
if(logged[playerid]) return SendClientMessage(playerid, COLOR_RED, "You are already logged in!");
new tmp[256];
tmp = dini_Get(file, "hashPW");
if(udb_hash(params) != strval(tmp))
{
format(string, 256, "You specified the wrong password for %s!", pname);
SendClientMessage(playerid, COLOR_RED, string);
}
else
{
logged[playerid] = 1;
level[playerid] = dini_Int(file, "level");
SendClientMessage(playerid, COLOR_YELLOW, "You have succesfully logged in!");
printf("%s (%i) logged in with password %s", pname, playerid, params);
}
return 1;
}
Does anybody care to show me the code?
Re: You cannot spawn without Login or register Command! -
Correlli - 19.07.2009
http://forum.sa-mp.com/index.php?top...3793#msg663793
Re: You cannot spawn without Login or register Command! -
clean180ollie - 19.07.2009
is dere a admin FS that does that,
edit:
I added a admin fs, But everytime i try to add the kick theres a error
Код:
error 001: expected token: ")", but found "-identifier-"
heres the code
Код:
public OnPlayerSpawn(playerid)
{
if(Variables[playerid][Jailed]) { SetPlayerInterior(playerid,3); SetPlayerPos(playerid,197.6661,173.8179,1003.0234); SetPlayerFacingAngle(playerid,0); }
if(Variables[playerid][Registered] == 0
Kick(playerid);
return 1;
}
Re: You cannot spawn without Login or register Command! -
Correlli - 19.07.2009
You forgot the ")":
pawn Код:
if(Variables[playerid][Registered] == 0) Kick(playerid);
Re: You cannot spawn without Login or register Command! -
clean180ollie - 19.07.2009
Thanksz