SA-MP Forums Archive
The code "keeping" - 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: The code "keeping" (/showthread.php?tid=330732)



The code "keeping" - Itzhak E. - 02.04.2012

Hey, first sorry on my bad English.
I tried to make a register system, and I did in OnDialogResponse
PHP код:
if(strlen(inputtext) < || strlen(inputtext) > 32)
{
// This is an example
// Code
return 0;

I did return 0; and if the player didn't wrote nothing the code moving to where you're chosing the skin


Re: The code "keeping" - BleverCastard - 02.04.2012

Код:
if(strlen(inputtext) < 4 || strlen(inputtext) > 32) 
{ 
SendClientMessage(Playerid,-1,"your password must be more than 4 characters long");
ShowPlayerDialog(playerid, blah blah);
return 0; 
}



Re: The code "keeping" - Itzhak E. - 02.04.2012

I'm saying that the dialog works perfectly, but it's moving to where player chosing the skin, with button "Spawn", did you understand..? like he can spawn with dialog On, I don't know how to explain it..


Re: The code "keeping" - Cjgogo - 02.04.2012

I understand perfectly,I had this bug also,well just define a loggedin player variable and set its value to 1 if the player managed to login by typing a password.And if he logged in without typing anyything,then let its value stand as 0.Now you must check it on OnPlayerSpawn function,if it's 0 kick the player,otherwise,welcome message!


Re: The code "keeping" - Itzhak E. - 02.04.2012

could you help me with that, I didn't understood you..
http://pastebin.com/xXATL6kp


Re: The code "keeping" - Cjgogo - 02.04.2012

I saw your code looks like there is a Logged variable declare wich is good,do this:
pawn Код:
public OnPlayerSpawn(playerid)
{
   if(Logged[playerid]==0) Kick(playerid); //if the player "logged in" without typing any password gets kicked
   return 1;
}