SA-MP Forums Archive
Need Help fast - 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: Need Help fast (/showthread.php?tid=363753)



Need Help fast - TheDeath - 28.07.2012

Hello can someone tell me why
pawn Код:
new Query[256],pName[MAX_PLAYER_NAME],Lang[3],Admin[3],VIP[3];
    GetPlayerName(playerid,pName,24);
    format(Query,sizeof(Query),"SELECT * FROM `users_drift` WHERE username = '%s' LIMIT 1",pName);
    mysql_query(Query);
    mysql_store_result();
    mysql_retrieve_row();
    mysql_get_field("Lang",Lang);
    mysql_get_field("Admin",Admin);
    mysql_get_field("VIP",VIP);
    if(mysql_num_rows() == 1){
    player_Language[playerid] = strval(Lang);
    player_Admin[playerid] = strval(Admin);
    player_VIP[playerid] = strval(VIP);
    print(player_Language[playerid]);
    print(player_Admin[playerid]);
    print(player_VIP[playerid]);
This code wont work i think everything is ok
They are all Int in mysql and they have lenght 1 they are 1 or 0
when i print them it says (null)


Re: Need Help fast - SomebodyAndMe - 28.07.2012

pawn Код:
new Query[256],pName[MAX_PLAYER_NAME],Lang[3],Admin[3],VIP[3];
    GetPlayerName(playerid,pName,24);
    format(Query,sizeof(Query),"SELECT * FROM `users_drift` WHERE username = '%s' LIMIT 1",pName);
    mysql_query(Query);
    mysql_store_result();
    mysql_retrieve_row();
    mysql_get_field("Lang",Lang);
    mysql_get_field("Admin",Admin);
    mysql_get_field("VIP",VIP);
    if(mysql_num_rows() == 1){
    player_Language[playerid] = strval(Lang);
    player_Admin[playerid] = strval(Admin);
    player_VIP[playerid] = strval(VIP);
    print(player_Language[playerid]);
    print(player_Admin[playerid]);
    print(player_VIP[playerid]);
    }
    else
    {
     // do nothing
    }



Re: Need Help fast - TheDeath - 28.07.2012

Actually i have Admin - 1 VIP - 1 Lang - 1
When i print them i get Lang -1 Admin - 0 VIP - 0