SA-MP Forums Archive
Our of boundries, script doesn't load. - 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: Our of boundries, script doesn't load. (/showthread.php?tid=450159)



Our of boundries, script doesn't load. - Darnell - 11.07.2013

I have this script, but after I click 'Register' and then 'Spawn'
It gives me a white screen and 'Stay within world boundries.'
It'll be appreciated if anyone else will test it.
http://pastebin.com/5fMvLV3c
I have no fucking idea whether it's related to MySQL or the script itself.


Re: Our of boundries, script doesn't load. - arakuta - 11.07.2013

I had exactly the same problem, and i solved it adding at least one AddPlayerClass at OnGameModeInit


Re: Our of boundries, script doesn't load. - Darnell - 11.07.2013

I fixed it, but MySQL_CreateAccount is not executed.


Re: Our of boundries, script doesn't load. - arakuta - 11.07.2013

Are u sure? It's impossible seeing your code.

Try a debug there:

pawn Код:
public MySQL_CheckAccount(playerid){
    GetPlayerName(playerid,PlayerName,25);
    format(s_Query,sizeof(s_Query),"SELECT * FROM `accounts` WHERE sUser = '%s'",PlayerName);
    mysql_function_query(s_MySQL,s_Query,true,"s@MySQL_CheckAccount","d",playerid);
    printf("Checking for: %s",PlayerName);
    return 1;
}
By the way, i was reading something about MySQL doesn't supporting 'localhost', you should use 127.0.0.1 or you local network ip adress...

@Edit FAIL, i've made a mistake with Create and Check, hehe

I dont't really know if it works

pawn Код:
if( 5 < (strlen(inputtext)) > 25)
But i'm sure this way works:

pawn Код:
if(strlen(inputtext) < 5 || strlen(inputtext) > 25)
    return Something;



Re: Our of boundries, script doesn't load. - Darnell - 11.07.2013

It writes it, but I don't know where it stores it, phpMyAdmin, right?


Re: Our of boundries, script doesn't load. - arakuta - 11.07.2013

Take a look at my post edit... /\

Whenever you call a mysql_query_function, MySQL plugin works, then pass the values you want to a response callback, in your case r@MySQL_CreateAccount


Re: Our of boundries, script doesn't load. - Darnell - 11.07.2013

Same.
Can you test it yourself, please? I have no idea what to do.
EDIT:
pawn Код:
public MySQL_CreateAccount(playerid,password[])
{
    GetPlayerName(playerid,PlayerName,25);
    format(s_Query,sizeof(s_Query),"INSERT INTO `accounts` (name,password,level,money,bank,skin) VALUES ('%s','%s','2','4500','0','240');",PlayerName,password);
    mysql_function_query(s_MySQL,s_Query,true,"s@MySQL_CreateAccount","s",playerid);
    printf("Creating: %s",PlayerName);
    return 1;
}

public s@MySQL_CreateAccount(playerid)
{
    print("Before message");
    SendClientMessage(playerid,-1,"Successfully registered, please wait.");
    print("after message");
    MySQL_LoadAccount(playerid);
   
    return 1;
}
Did this debug. this is the outcome:
Quote:

Frank_Albertini has joined the server
Checking for: Frank_Albertini
Showed Register to 1,s@MySQL_CheckAccount
Creating: Frank_Albertini




Re: Our of boundries, script doesn't load. - Darnell - 11.07.2013

I've fixed it, thanks for the help.