Mysql Login System[Problem]
#1

Hello,

When I join my server, I can't log in, register or do anything. I'm using Mysql. Here are it's lines :
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	switch(dialogid)
	{
	    case DIALOG_LOGIN:
	    {
	        new szHashedPassword[129];
	        WP_Hash(szHashedPassword, 129, inputtext);
	        
	        if(!response) return KickPlayer(playerid);
	        if(response)
	        {
         		if(!strcmp(AccountData[playerid][pPassword], szHashedPassword, true, 128))
         		{
         		    LoginPlayer(playerid);
         		}
         		else
         		{
         		    SendClientMessage(playerid, -1, "Incorrect password, please try again.");
					format(szOutput, sizeof(szOutput), "{FFFFFF}Hello, welcome to "SERVER_NAME"! We have found you are registered.\n\n[Username]: {E3DD3B}%s{FFFFFF} - [IP]: {E3DD3B}%s{FFFFFF}\n\nPlease enter your password below to login.", ReturnPlayerName(playerid), AccountData[playerid][pIP]);
		        	ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "{42C2F5}["SERVER_NAME": {FFFFFF}Login{42C2F5}]", szOutput, "Login", "");
         		}
	        }
	    }
	    case DIALOG_REGISTER:
	    {
	        if(!response) return KickPlayer(playerid);
			if(strlen(inputtext) < 6)
			{
			    SendClientMessage(playerid, -1, "You're account password must consist of atleast 6 characters.");
				format(szOutput, sizeof(szOutput), "{FFFFFF}Hello, welcome to "SERVER_NAME"! We have found you are not registered.\n\n[Username]: {E3DD3B}%s{FFFFFF} - [IP]: {E3DD3B}%s{FFFFFF}\n\nIt seems you are not registered, enter a password below to do-so!", ReturnPlayerName(playerid), AccountData[playerid][pIP]);
		        return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "{42C2F5}["SERVER_NAME": {FFFFFF}Login{42C2F5}]", szOutput, "Register", "Quit");
			}
	        if(response)
	        {
	            WP_Hash(AccountData[playerid][pPassword], 129, inputtext);

	            format(szQuery, sizeof(szQuery), "INSERT INTO `accounts` (username, password, ip, adminlevel) VALUES ('%s', '%s', '%s', '0')", ReturnPlayerName(playerid), AccountData[playerid][pPassword], AccountData[playerid][pIP]);
                mysql_function_query(MainPipeline, szQuery, true, "OnQueryFinish", "ii", THREAD_NO_RESULT, playerid);

                ShowPlayerDialog(playerid,DIALOG_AGE, DIALOG_STYLE_INPUT, "Age", "Enter your age below:", "Procceed", "");
		    }
	    }
	    case DIALOG_AGE:
	    {
	        if(!response) return ShowPlayerDialog(playerid,DIALOG_AGE, DIALOG_STYLE_INPUT, "Age", "Enter your age below:", "Procceed", "");
	        if(!strlen(inputtext)) return ShowPlayerDialog(playerid,DIALOG_AGE, DIALOG_STYLE_INPUT, "Age", "Enter your age below:", "Procceed", "");
			if(strval(inputtext) < 1 || strval(inputtext) > 99)
			{
			    SendClientMessage(playerid, -1, "You're account password must consist of atleast 6 characters.");
                ShowPlayerDialog(playerid,DIALOG_AGE, DIALOG_STYLE_INPUT, "Age", "Enter your age below\nInvalid age specified", "Procceed", "");
			}
	        if(response)
	        {
	            new string[64];
	            AccountData[playerid][pAge] = strval(inputtext);
	            format(string, sizeof(string), "Okay, we know that you are %d years old", AccountData[playerid][pAge]);
	            
	            ShowPlayerDialog(playerid, DIALOG_GENDER, DIALOG_STYLE_LIST, "Select your gender", "Male\nFemale", "Choose", "");
		    }
	    }
	    case DIALOG_GENDER:
	    {
	        if(!response) return ShowPlayerDialog(playerid, DIALOG_GENDER, DIALOG_STYLE_LIST, "Select your gender", "Male\nFemale", "Choose", "");
	        if(response)
	        {
	            new string[64];
	            AccountData[playerid][pGender] = listitem+1;
	            format(string, sizeof(string), "Okay, we know that you are a %s", GetGender(playerid, false));
	            
	            TogglePlayerSpectating(playerid, 0);
	            SetPlayerInterior(playerid, 0);
	            SetPlayerVirtualWorld(playerid, 0);

	            AccountData[playerid][pCash] = 500;
	            AccountData[playerid][pHealth] = 100;
	            AccountData[playerid][pAutoLogin] = 1;
			    AccountData[playerid][pMusicStreaming] = 1;
			    AccountData[playerid][pNewbieToggled] = 1;
			    AccountData[playerid][pAdmin] = 0;
	            AccountData[playerid][pLevel] = 1;
	            GivePlayerMoney(playerid, AccountData[playerid][pCash]);
	            SetPlayerScore(playerid, AccountData[playerid][pLevel]);
	            
	            new
				    day,
				    month,
				    year,
				    hour,
				    minute,
				    second
			  	;
How to fix it ?
Thank You.
Also, How to put Pawno Code ?
Reply
#2

*BUMP* I still need help.
Any one ?
Reply
#3

Show us the "OnPlayerConnect" callback
Reply
#4

Quote:
Originally Posted by Koala818
Посмотреть сообщение
Show us the "OnPlayerConnect" callback
Код:
public OnPlayerConnect(playerid)
{
    ClearVariables(playerid);
	new ip[15];
	TogglePlayerSpectating(playerid, 1);
    SetPlayerColor(playerid, WHITE);
    ClearChat(playerid, 50);
    
    GetPlayerIp(playerid, ip, sizeof(ip));

	format(szQuery, sizeof(szQuery), "SELECT * FROM `accounts` WHERE `username` = '%s'", ReturnPlayerName(playerid));
	mysql_function_query(MainPipeline, szQuery, true, "OnQueryFinish", "ii", THREAD_CHECK_ACCOUNT, playerid);
	
	format(szQuery, sizeof(szQuery), "INSERT INTO `connections` (`Name`, `IP`, `Date`) VALUES ('%s', '%s', '%s')", ReturnPlayerName(playerid), ip, TimeDate());
	mysql_function_query(MainPipeline, szQuery, true, "OnQueryFinish", "ii", THREAD_NO_RESULT, playerid);

	
	DeleteObjectsForPlayer(playerid);
	return 1;
}
Reply
#5

Now show us the "OnQueryFinish" function.
Reply
#6

Quote:
Originally Posted by Koala818
Посмотреть сообщение
Now show us the "OnQueryFinish" function.
Код:
public OnQueryFinish(resultid, extraid, ConnectionHandle)
{
	new szRows, szFields;

	if(resultid != THREAD_NO_RESULT)
	{
		cache_get_data(szRows, szFields);
	}

	switch(resultid)
	{
	    case THREAD_LOAD_HOUSES:
	    {
	        if(szRows)
	        {
	            new temp[130], totalhouses;
	            for(new i = 0; i < szRows; i++)
    			{
					new houseID;

					cache_get_field_content(i, "HouseIDz",   temp);
					houseID = strval(temp);
					
					cache_get_field_content(i, "house_Tag", temp);
                    format(HouseData[houseID][house_Tag], 50, "%s", temp);
                    
                    cache_get_field_content(i, "house_Owner", temp);
                    format(HouseData[houseID][house_Owner], 50, "%s", temp);

					cache_get_field_content(i, "house_X", temp);
					HouseData[houseID][house_OutsidePosition][0] = floatstr(temp);
					cache_get_field_content(i, "house_Y", temp);
					HouseData[houseID][house_OutsidePosition][1] = floatstr(temp);
					cache_get_field_content(i, "house_Z", temp);
					HouseData[houseID][house_OutsidePosition][2] = floatstr(temp);
					cache_get_field_content(i, "house_A", temp);
					HouseData[houseID][house_OutsidePosition][3] = floatstr(temp);
					
					cache_get_field_content(i, "house_Owned",   temp);
					HouseData[houseID][house_Owned] = strval(temp);

					cache_get_field_content(i, "house_Value", temp);
					HouseData[houseID][house_Value] = strval(temp);
					
					cache_get_field_content(i, "house_Level", temp);
					HouseData[houseID][house_Level] = strval(temp);
					
					cache_get_field_content(i, "house_Locked", temp);
					HouseData[houseID][house_Locked] = strval(temp);
					
					cache_get_field_content(i, "house_OutsideINT", temp);
					HouseData[houseID][house_OutsideVW] = strval(temp);
					
					cache_get_field_content(i, "house_OutsideINT", temp);
					HouseData[houseID][house_OutsideINT] = strval(temp);
					
					
					HouseData[houseID][house_Taken] = 1;
					
					SetHouseInterior(houseID);
    				UpdateHouseLabel(houseID);
    				totalhouses ++;
	    		}
	    		printf("Chill Role Play - Loaded %i houses", totalhouses);
	        }
	    }
Reply
#7

Quote:
Originally Posted by EgyptForLife
Посмотреть сообщение
Код:
public OnQueryFinish(resultid, extraid, ConnectionHandle)
{
	new szRows, szFields;

	if(resultid != THREAD_NO_RESULT)
	{
		cache_get_data(szRows, szFields);
	}

	switch(resultid)
	{
	    case THREAD_LOAD_HOUSES:
	    {
	        if(szRows)
	        {
	            new temp[130], totalhouses;
	            for(new i = 0; i < szRows; i++)
    			{
					new houseID;

					cache_get_field_content(i, "HouseIDz",   temp);
					houseID = strval(temp);
					
					cache_get_field_content(i, "house_Tag", temp);
                    format(HouseData[houseID][house_Tag], 50, "%s", temp);
                    
                    cache_get_field_content(i, "house_Owner", temp);
                    format(HouseData[houseID][house_Owner], 50, "%s", temp);

					cache_get_field_content(i, "house_X", temp);
					HouseData[houseID][house_OutsidePosition][0] = floatstr(temp);
					cache_get_field_content(i, "house_Y", temp);
					HouseData[houseID][house_OutsidePosition][1] = floatstr(temp);
					cache_get_field_content(i, "house_Z", temp);
					HouseData[houseID][house_OutsidePosition][2] = floatstr(temp);
					cache_get_field_content(i, "house_A", temp);
					HouseData[houseID][house_OutsidePosition][3] = floatstr(temp);
					
					cache_get_field_content(i, "house_Owned",   temp);
					HouseData[houseID][house_Owned] = strval(temp);

					cache_get_field_content(i, "house_Value", temp);
					HouseData[houseID][house_Value] = strval(temp);
					
					cache_get_field_content(i, "house_Level", temp);
					HouseData[houseID][house_Level] = strval(temp);
					
					cache_get_field_content(i, "house_Locked", temp);
					HouseData[houseID][house_Locked] = strval(temp);
					
					cache_get_field_content(i, "house_OutsideINT", temp);
					HouseData[houseID][house_OutsideVW] = strval(temp);
					
					cache_get_field_content(i, "house_OutsideINT", temp);
					HouseData[houseID][house_OutsideINT] = strval(temp);
					
					
					HouseData[houseID][house_Taken] = 1;
					
					SetHouseInterior(houseID);
    				UpdateHouseLabel(houseID);
    				totalhouses ++;
	    		}
	    		printf("Chill Role Play - Loaded %i houses", totalhouses);
	        }
	    }
That's not the whole function. What you wrote will only load Some dates in the HouseData array. The problem must be in the "case THREAD_CHECK_ACCOUNT".
Reply
#8

Quote:
Originally Posted by Koala818
Посмотреть сообщение
That's not the whole function. What you wrote will only load Some dates in the HouseData array. The problem must be in the "case THREAD_CHECK_ACCOUNT".
Is it this all of it ?
Код:
public OnQueryFinish(resultid, extraid, ConnectionHandle)
{
	new szRows, szFields;

	if(resultid != THREAD_NO_RESULT)
	{
		cache_get_data(szRows, szFields);
	}

	switch(resultid)
	{
	    case THREAD_LOAD_HOUSES:
	    {
	        if(szRows)
	        {
	            new temp[130], totalhouses;
	            for(new i = 0; i < szRows; i++)
    			{
					new houseID;

					cache_get_field_content(i, "HouseIDz",   temp);
					houseID = strval(temp);
					
					cache_get_field_content(i, "house_Tag", temp);
                    format(HouseData[houseID][house_Tag], 50, "%s", temp);
                    
                    cache_get_field_content(i, "house_Owner", temp);
                    format(HouseData[houseID][house_Owner], 50, "%s", temp);

					cache_get_field_content(i, "house_X", temp);
					HouseData[houseID][house_OutsidePosition][0] = floatstr(temp);
					cache_get_field_content(i, "house_Y", temp);
					HouseData[houseID][house_OutsidePosition][1] = floatstr(temp);
					cache_get_field_content(i, "house_Z", temp);
					HouseData[houseID][house_OutsidePosition][2] = floatstr(temp);
					cache_get_field_content(i, "house_A", temp);
					HouseData[houseID][house_OutsidePosition][3] = floatstr(temp);
					
					cache_get_field_content(i, "house_Owned",   temp);
					HouseData[houseID][house_Owned] = strval(temp);

					cache_get_field_content(i, "house_Value", temp);
					HouseData[houseID][house_Value] = strval(temp);
					
					cache_get_field_content(i, "house_Level", temp);
					HouseData[houseID][house_Level] = strval(temp);
					
					cache_get_field_content(i, "house_Locked", temp);
					HouseData[houseID][house_Locked] = strval(temp);
					
					cache_get_field_content(i, "house_OutsideINT", temp);
					HouseData[houseID][house_OutsideVW] = strval(temp);
					
					cache_get_field_content(i, "house_OutsideINT", temp);
					HouseData[houseID][house_OutsideINT] = strval(temp);
					
					
					HouseData[houseID][house_Taken] = 1;
					
					SetHouseInterior(houseID);
    				UpdateHouseLabel(houseID);
    				totalhouses ++;
	    		}
	    		printf("Chill Role Play - Loaded %i houses", totalhouses);
	        }
	    }
	    case THREAD_LOAD_ARRESTPOINT:
	    {
	        new totalarrestpoints = 0;
	        if(szRows)
	        {
	            new temp[130];
	            for(new i = 0; i < szRows; i++)
    			{
					new arrestpointID;

					cache_get_field_content(i, "arrestpointID",   temp);
					arrestpointID = strval(temp);

					cache_get_field_content(i, "Arrest_X", temp);
					ArrestPointData[arrestpointID][Arrest_Pos][0] = floatstr(temp);
					cache_get_field_content(i, "Arrest_Y", temp);
					ArrestPointData[arrestpointID][Arrest_Pos][1] = floatstr(temp);
					cache_get_field_content(i, "Arrest_Z", temp);
					ArrestPointData[arrestpointID][Arrest_Pos][2] = floatstr(temp);

					ArrestPointData[arrestpointID][arrest_Taken] = 1;
                    UpdateArrestPointLabel(arrestpointID);

					totalarrestpoints++;
	    		}
	        }
	        printf("Liberty Roleplay - Loaded %i arrestpoints", totalarrestpoints);
	    }
	    case THREAD_LOAD_VEHICLES:
	    {
	        new totalvehicles = 0;
	        if(szRows)
	        {
	            new temp[130];
	            for(new i = 0; i < szRows; i++)
    			{
					new vehicleID;

					cache_get_field_content(i, "vehicleIDz",   temp);
					vehicleID = strval(temp);
					
					cache_get_field_content(i, "veh_Owner", temp);
					format(VehicleData[vehicleID][veh_Owner], 50, "%s", temp);
					
					if(!strcmp(VehicleData[vehicleID][veh_Owner], "None", true, 16))
					{

						cache_get_field_content(i, "veh_PosX", temp);
						VehicleData[vehicleID][veh_OutsidePosition][0] = floatstr(temp);
						cache_get_field_content(i, "veh_PosY", temp);
						VehicleData[vehicleID][veh_OutsidePosition][1] = floatstr(temp);
						cache_get_field_content(i, "veh_PosZ", temp);
						VehicleData[vehicleID][veh_OutsidePosition][2] = floatstr(temp);
						cache_get_field_content(i, "veh_PosA", temp);
						VehicleData[vehicleID][veh_OutsidePosition][3] = floatstr(temp);

						cache_get_field_content(i, "veh_Int",   temp);
						VehicleData[vehicleID][veh_INT] = strval(temp);

						cache_get_field_content(i, "veh_VW", temp);
						VehicleData[vehicleID][veh_VW] = strval(temp);

						cache_get_field_content(i, "veh_Model", temp);
						VehicleData[vehicleID][veh_Model] = strval(temp);

						cache_get_field_content(i, "veh_Color1", temp);
						VehicleData[vehicleID][veh_Color1] = strval(temp);

						cache_get_field_content(i, "veh_Color2", temp);
						VehicleData[vehicleID][veh_Color2] = strval(temp);

						cache_get_field_content(i, "veh_Faction", temp);
						VehicleData[vehicleID][veh_Faction] = strval(temp);

						cache_get_field_content(i, "veh_Job", temp);
						VehicleData[vehicleID][veh_Job] = strval(temp);

						cache_get_field_content(i, "veh_Family", temp);
						VehicleData[vehicleID][veh_Family] = strval(temp);

						VehicleData[vehicleID][veh_Taken] = 1;

	                    CreateVehicle(VehicleData[vehicleID][veh_Model], VehicleData[vehicleID][veh_OutsidePosition][0],VehicleData[vehicleID][veh_OutsidePosition][1], VehicleData[vehicleID][veh_OutsidePosition][2], VehicleData[vehicleID][veh_OutsidePosition][3], VehicleData[vehicleID][veh_Color1], VehicleData[vehicleID][veh_Color2], -1);
						totalvehicles++;
					}
	    		}
	        }
	        printf("Liberty Roleplay - Loaded %i vehicles", totalvehicles);
	    }
	    case THREAD_LOAD_DEALERSHIPS:
	    {
	        if(szRows)
	        {
	            new temp[130], dealerz;
	            for(new i = 0; i < szRows; i++)
    			{
					new dealerID;

					cache_get_field_content(i, "dealerIDs",   temp);
					dealerID = strval(temp);

                    cache_get_field_content(i, "dealer_Owner", temp);
                    format(DealerData[dealerID][dealer_Owner], 50, "%s", temp);

					cache_get_field_content(i, "dealer_X", temp);
					DealerData[dealerID][dealer_OutsidePosition][0] = floatstr(temp);
					cache_get_field_content(i, "dealer_Y", temp);
					DealerData[dealerID][dealer_OutsidePosition][1] = floatstr(temp);
					cache_get_field_content(i, "dealer_Z", temp);
					DealerData[dealerID][dealer_OutsidePosition][2] = floatstr(temp);
					cache_get_field_content(i, "dealer_A", temp);
					DealerData[dealerID][dealer_OutsidePosition][3] = floatstr(temp);
					
					DealerData[dealerID][dealer_Taken] = 1;

    				UpdateDealerLabel(dealerID);
					
					cache_get_field_content(i, "dealer_CarX", temp);
					DealerData[dealerID][dealer_VehicleSpawnPos][0] = floatstr(temp);
					cache_get_field_content(i, "dealer_CarY", temp);
					DealerData[dealerID][dealer_VehicleSpawnPos][1] = floatstr(temp);
					cache_get_field_content(i, "dealer_CarZ", temp);
					DealerData[dealerID][dealer_VehicleSpawnPos][2] = floatstr(temp);
					cache_get_field_content(i, "dealer_CarA", temp);
					DealerData[dealerID][dealer_VehicleSpawnPos][3] = floatstr(temp);

					cache_get_field_content(i, "dealer_Owned",  temp);
					DealerData[dealerID][dealer_Owned] = strval(temp);
					
					cache_get_field_content(i, "dealer_Value", temp);
					DealerData[dealerID][dealer_Value] = strval(temp);
					
					cache_get_field_content(i, "dealer_Locked", temp);
					DealerData[dealerID][dealer_Locked] = strval(temp);

					cache_get_field_content(i, "dealer_Safe", temp);
					DealerData[dealerID][dealer_Safe] = strval(temp);

					cache_get_field_content(i, "dealer_OutsideINT", temp);
					DealerData[dealerID][dealer_OutsideINT] = strval(temp);

					cache_get_field_content(i, "dealer_OutsideVW", temp);
					DealerData[dealerID][dealer_OutsideVW] = strval(temp);
					
					cache_get_field_content(i, "dealer_Vehicle1", temp);
					DealerData[dealerID][dealer_Vehicle1] = strval(temp);
					
					cache_get_field_content(i, "dealer_Vehicle2", temp);
					DealerData[dealerID][dealer_Vehicle2] = strval(temp);
					
					cache_get_field_content(i, "dealer_Vehicle3", temp);
					DealerData[dealerID][dealer_Vehicle3] = strval(temp);
					
					cache_get_field_content(i, "dealer_Vehicle4", temp);
					DealerData[dealerID][dealer_Vehicle4] = strval(temp);

					cache_get_field_content(i, "dealer_Vehicle5", temp);
					DealerData[dealerID][dealer_Vehicle5] = strval(temp);

					cache_get_field_content(i, "dealer_Vehicle6", temp);
					DealerData[dealerID][dealer_Vehicle6] = strval(temp);
					
					cache_get_field_content(i, "dealer_Vehicle7", temp);
					DealerData[dealerID][dealer_Vehicle7] = strval(temp);

					cache_get_field_content(i, "dealer_Vehicle8", temp);
					DealerData[dealerID][dealer_Vehicle8] = strval(temp);

					cache_get_field_content(i, "dealer_Vehicle9", temp);
					DealerData[dealerID][dealer_Vehicle9] = strval(temp);
					
					cache_get_field_content(i, "dealer_Vehicle10", temp);
					DealerData[dealerID][dealer_Vehicle10] = strval(temp);

                    cache_get_field_content(i, "dealer_VehiclePrice1", temp);
					DealerData[dealerID][dealer_VehiclePrice1] = strval(temp);
					
					cache_get_field_content(i, "dealer_VehiclePrice2", temp);
					DealerData[dealerID][dealer_VehiclePrice2] = strval(temp);
					
					cache_get_field_content(i, "dealer_VehiclePrice3", temp);
					DealerData[dealerID][dealer_VehiclePrice3] = strval(temp);
					
					cache_get_field_content(i, "dealer_VehiclePrice4", temp);
					DealerData[dealerID][dealer_VehiclePrice4] = strval(temp);

					cache_get_field_content(i, "dealer_VehiclePrice5", temp);
					DealerData[dealerID][dealer_VehiclePrice5] = strval(temp);

					cache_get_field_content(i, "dealer_VehiclePrice6", temp);
					DealerData[dealerID][dealer_VehiclePrice6] = strval(temp);
					
					cache_get_field_content(i, "dealer_VehiclePrice7", temp);
					DealerData[dealerID][dealer_VehiclePrice7] = strval(temp);

					cache_get_field_content(i, "dealer_VehiclePrice8", temp);
					DealerData[dealerID][dealer_VehiclePrice8] = strval(temp);

					cache_get_field_content(i, "dealer_VehiclePrice9", temp);
					DealerData[dealerID][dealer_VehiclePrice9] = strval(temp);
					
                    cache_get_field_content(i, "dealer_VehiclePrice10", temp);
					DealerData[dealerID][dealer_VehiclePrice10] = strval(temp);

					dealerz ++;
	    		}
                printf("Liberty Roleplay: %i dealerships loaded!", dealerz);
	        }
	    }
	    case THREAD_LOAD_BIZS:
	    {
	        if(szRows)
	        {
	            new temp[130], bizloaded;
	            for(new i = 0; i < szRows; i++)
    			{
					new bizID;

					cache_get_field_content(i, "bizIDs",   temp);
					bizID = strval(temp);
					
                    cache_get_field_content(i, "biz_Owner", temp);
                    format(BizData[bizID][biz_Owner], 50, "%s", temp);

					cache_get_field_content(i, "biz_X", temp);
					BizData[bizID][biz_OutsidePosition][0] = floatstr(temp);
					cache_get_field_content(i, "biz_Y", temp);
					BizData[bizID][biz_OutsidePosition][1] = floatstr(temp);
					cache_get_field_content(i, "biz_Z", temp);
					BizData[bizID][biz_OutsidePosition][2] = floatstr(temp);
					cache_get_field_content(i, "biz_A", temp);
					BizData[bizID][biz_OutsidePosition][3] = floatstr(temp);

					cache_get_field_content(i, "biz_Owned",   temp);
					BizData[bizID][biz_Owned] = strval(temp);
					cache_get_field_content(i, "biz_Value", temp);
					BizData[bizID][biz_Value] = strval(temp);
					cache_get_field_content(i, "biz_Level", temp);
					BizData[bizID][biz_Level] = strval(temp);
					cache_get_field_content(i, "biz_Locked", temp);
					BizData[bizID][biz_Locked] = strval(temp);
					cache_get_field_content(i, "biz_Type", temp);
					BizData[bizID][biz_Type] = strval(temp);
					
					cache_get_field_content(i, "biz_Safe", temp);
					BizData[bizID][biz_Safe] = strval(temp);
					
					cache_get_field_content(i, "biz_OutsideINT", temp);
					BizData[bizID][biz_OutsideINT] = strval(temp);

					cache_get_field_content(i, "biz_OutsideVW", temp);
					BizData[bizID][biz_OutsideVW] = strval(temp);

                    cache_get_field_content(i, "biz_ProductPrice1", temp);
					BizData[bizID][biz_ProductPrice1] = strval(temp);

					BizData[bizID][biz_Taken] = 1;

                    SetBizInterior(bizID);
					SetHouseInterior(bizID);
    				UpdateBizLabel(bizID);
					bizloaded ++;
	    		}
                printf("Liberty Roleplay: %i businesses loaded!", bizloaded);
	        }
	    }
	    case THREAD_LOAD_JOBS:
	    {
	        if(szRows)
	        {
	            new temp[130];
	            for(new i = 0; i < szRows; i++)
    			{
					new jobID;

					cache_get_field_content(i, "jobIDz",   temp);
					jobID = strval(temp);

                    cache_get_field_content(i, "job_Name", temp);
                    format(JobData[jobID][job_Name], 50, "%s", temp);

					cache_get_field_content(i, "job_X", temp);
					JobData[jobID][job_OutsidePosition][0] = floatstr(temp);
					cache_get_field_content(i, "job_Y", temp);
					JobData[jobID][job_OutsidePosition][1] = floatstr(temp);
					cache_get_field_content(i, "job_Z", temp);
					JobData[jobID][job_OutsidePosition][2] = floatstr(temp);

					cache_get_field_content(i, "job_INT",   temp);
					JobData[jobID][job_INT] = strval(temp);
					
					cache_get_field_content(i, "job_Type",   temp);
					JobData[jobID][job_Type] = strval(temp);
					
					cache_get_field_content(i, "job_VW", temp);
					JobData[jobID][job_VW] = strval(temp);
					
					JobData[jobID][job_Taken] = 1;
					
    				UpdateJobLabel(jobID);
					printf("Job %s(ID: %i) has been loaded", JobData[jobID][job_Name], jobID);

	    		}
	        }
	    }
	    case THREAD_LOAD_FAMILIES:
	    {
	        if(szRows)
	        {
	            new temp[130];
	            for(new i = 0; i < szRows; i++)
    			{
					new familyID;

					cache_get_field_content(i, "FamilyID",   temp);
					familyID = strval(temp);

                    cache_get_field_content(i, "familyname", temp);
                    format(FamilyData[familyID][fam_Name], 50, "%s", temp);

                    cache_get_field_content(i, "fam_Leader", temp);
                    format(FamilyData[familyID][fam_Leader], 50, "%s", temp);

                    cache_get_field_content(i, "rank0", temp);
                    format(FamilyData[familyID][fam_Rank0], 50, "%s", temp);
                    cache_get_field_content(i, "rank1", temp);
                    format(FamilyData[familyID][fam_Rank1], 50, "%s", temp);
                    cache_get_field_content(i, "rank2", temp);
                    format(FamilyData[familyID][fam_Rank2], 50, "%s", temp);
                    cache_get_field_content(i, "rank3", temp);
                    format(FamilyData[familyID][fam_Rank3], 50, "%s", temp);
                    cache_get_field_content(i, "rank4", temp);
                    format(FamilyData[familyID][fam_Rank4], 50, "%s", temp);
                    cache_get_field_content(i, "rank5", temp);
                    format(FamilyData[familyID][fam_Rank5], 50, "%s", temp);
                    cache_get_field_content(i, "rank6", temp);
                    format(FamilyData[familyID][fam_Rank6], 50, "%s", temp);
                    
                    cache_get_field_content(i, "strike1", temp);
                    format(FamilyData[familyID][fam_Strike1], 50, "%s", temp);
                    cache_get_field_content(i, "strike2", temp);
                    format(FamilyData[familyID][fam_Strike2], 50, "%s", temp);
                    cache_get_field_content(i, "strike3", temp);
                    format(FamilyData[familyID][fam_Strike3], 50, "%s", temp);

                    cache_get_field_content(i, "strikes", temp);
					FamilyData[familyID][fam_TotalStrikes] = strval(temp);
					
                    cache_get_field_content(i, "maxskins", temp);
					FamilyData[familyID][fam_MaxSkins] = strval(temp);
					
					cache_get_field_content(i, "skin1", temp);
					FamilyData[familyID][fam_Skin1] = strval(temp);
					
					cache_get_field_content(i, "skin2", temp);
					FamilyData[familyID][fam_Skin2] = strval(temp);
					
					cache_get_field_content(i, "skin3", temp);
					FamilyData[familyID][fam_Skin3] = strval(temp);
					
					cache_get_field_content(i, "skin4", temp);
					FamilyData[familyID][fam_Skin4] = strval(temp);
					
					cache_get_field_content(i, "skin5", temp);
					FamilyData[familyID][fam_Skin5] = strval(temp);
					
					cache_get_field_content(i, "skin6", temp);
					FamilyData[familyID][fam_Skin6] = strval(temp);
					
					cache_get_field_content(i, "skin7", temp);
					FamilyData[familyID][fam_Skin7] = strval(temp);

					FamilyData[familyID][fam_Taken] = 1;

					printf("Family %s(%i) has been loaded", FamilyData[familyID][fam_Name], familyID);
	    		}
	        }
	    }
	    case THREAD_LOAD_FACTION:
	    {
	        if(szRows)
	        {
	            new temp[130];
	            for(new i = 0; i < szRows; i++)
    			{
					new factionid;
					
					cache_get_field_content(i, "FactionIDz",   temp);
					factionid = strval(temp);
                    
                    cache_get_field_content(i, "factionname", temp);
                    format(FactionData[factionid][fac_Name], 50, "%s", temp);
                    
                    cache_get_field_content(i, "fac_Leader", temp);
                    format(FactionData[factionid][fac_Leader], 50, "%s", temp);
                    
                    cache_get_field_content(i, "rank0", temp);
                    format(FactionData[factionid][fac_Rank0], 50, "%s", temp);
                    cache_get_field_content(i, "rank1", temp);
                    format(FactionData[factionid][fac_Rank1], 50, "%s", temp);
                    cache_get_field_content(i, "rank2", temp);
                    format(FactionData[factionid][fac_Rank2], 50, "%s", temp);
                    cache_get_field_content(i, "rank3", temp);
                    format(FactionData[factionid][fac_Rank3], 50, "%s", temp);
                    cache_get_field_content(i, "rank4", temp);
                    format(FactionData[factionid][fac_Rank4], 50, "%s", temp);
                    cache_get_field_content(i, "rank5", temp);
                    format(FactionData[factionid][fac_Rank5], 50, "%s", temp);
                    cache_get_field_content(i, "rank6", temp);
                    format(FactionData[factionid][fac_Rank6], 50, "%s", temp);
                    
					
					cache_get_field_content(i, "fac_color", temp);
                    sscanf(temp, "x", FactionData[factionid][fac_Color]);
					
					cache_get_field_content(i, "fac_members", temp);
					FactionData[factionid][fac_Members] = strval(temp);

					cache_get_field_content(i, "fac_type", temp);
					FactionData[factionid][fac_Type] = strval(temp);
					
					cache_get_field_content(i, "fac_taken", temp);
					FactionData[factionid][fac_Taken] = strval(temp);
					
					switch(FactionData[factionid][fac_Type])
					{
					    case 1: FactionData[factionid][fac_Type] = FAC_TYPE_LEO;
					    case 2: FactionData[factionid][fac_Type] = FAC_TYPE_LSFMD;
					    case 3: FactionData[factionid][fac_Type] = FAC_TYPE_HITMEN;
					    case 4: FactionData[factionid][fac_Type] = FAC_TYPE_FBI;
					}
					printf("Faction %s(%i) has been loaded", FactionData[factionid][fac_Name], factionid);
	    		}
	        }
	    }
	    case THREAD_LOAD_BANKS:
	    {
	        if(szRows)
	        {
	            new temp[130], totalbanks = 0;
	            for(new i = 0; i < szRows; i++)
    			{
					new bankID;

					cache_get_field_content(i, "bankID",   temp);
					bankID = strval(temp);
                    
					cache_get_field_content(i, "bankx", temp);
					BankData[bankID][bank_Pos][0] = floatstr(temp);
					cache_get_field_content(i, "banky", temp);
					BankData[bankID][bank_Pos][1] = floatstr(temp);
					cache_get_field_content(i, "bankz", temp);
					BankData[bankID][bank_Pos][2] = floatstr(temp);
					cache_get_field_content(i, "banka", temp);
					BankData[bankID][bank_Pos][3] = floatstr(temp);
					
					BankData[bankID][bank_Taken] = 1;

                    cache_get_field_content(i, "bank_vw", temp);
					BankData[bankID][bank_VW] = strval(temp);

                    UpdateBankLabel(bankID);
                    totalbanks ++;
	    		}
	    		printf("Liberty Roleplay: %i banks loaded!", totalbanks);
	        }
	    }
	    case THREAD_LOAD_DOOR:
	    {
	        if(szRows)
	        {
	            new temp[130], string[128], totaldoors;
	            for(new i = 0; i < szRows; i++)
    			{
					new doorID;

					cache_get_field_content(i, "doorIDz",   temp);
					doorID = strval(temp);

					cache_get_field_content(i, "door_Name", temp);
				 	format(DoorData[doorID][door_Name], 50, "%s", temp);
                    
                    cache_get_field_content(i, "InsideX", temp);
					DoorData[doorID][door_InsidePosition][0] = floatstr(temp);
					cache_get_field_content(i, "InsideY", temp);
					DoorData[doorID][door_InsidePosition][1] = floatstr(temp);
					cache_get_field_content(i, "InsideZ", temp);
					DoorData[doorID][door_InsidePosition][2] = floatstr(temp);
					cache_get_field_content(i, "InsideA", temp);
					DoorData[doorID][door_InsidePosition][3] = floatstr(temp);
					
					cache_get_field_content(i, "OutsideX", temp);
					DoorData[doorID][door_OutsidePosition][0] = floatstr(temp);
					cache_get_field_content(i, "OutsideY", temp);
					DoorData[doorID][door_OutsidePosition][1] = floatstr(temp);
					cache_get_field_content(i, "OutsideZ", temp);
					DoorData[doorID][door_OutsidePosition][2] = floatstr(temp);
					cache_get_field_content(i, "OutsideA", temp);
					DoorData[doorID][door_OutsidePosition][3] = floatstr(temp);

					cache_get_field_content(i, "door_Taken",   temp);
					DoorData[doorID][door_Taken] = strval(temp);

					cache_get_field_content(i, "door_Faction", temp);
					DoorData[doorID][door_Faction] = strval(temp);
					
                    cache_get_field_content(i, "door_InsideVW", temp);
					DoorData[doorID][door_InsideVW] = strval(temp);
					cache_get_field_content(i, "door_OutsideVW", temp);
					DoorData[doorID][door_OutsideVW] = strval(temp);
					cache_get_field_content(i, "door_InsideInt", temp);
					DoorData[doorID][door_InsideINT] = strval(temp);
					cache_get_field_content(i, "door_OutsideInt", temp);
					DoorData[doorID][door_OutsideINT] = strval(temp);
					
					DoorData[doorID][door_iPickup] = CreateDynamicPickup(1239, 23, DoorData[doorID][door_InsidePosition][0], DoorData[doorID][door_InsidePosition][1], DoorData[doorID][door_InsidePosition][2], DoorData[doorID][door_InsideVW]);
					
					DoorData[doorID][door_Pickup] = CreateDynamicPickup(1239, 23, DoorData[doorID][door_OutsidePosition][0], DoorData[doorID][door_OutsidePosition][1], DoorData[doorID][door_OutsidePosition][2], DoorData[doorID][door_OutsideVW]);
					format(string, sizeof(string), "%s\nType {FFFFFF}/enter{F5DEB3} to enter this building.", DoorData[doorID][door_Name]);
				 	DoorData[doorID][door_Label] = CreateStreamed3DTextLabel(string, YELLOW2, DoorData[doorID][door_OutsidePosition][0], DoorData[doorID][door_OutsidePosition][1], DoorData[doorID][door_OutsidePosition][2]+0.5, 10.0, DoorData[doorID][door_OutsideVW]);

					totaldoors ++;
	    		}
	    		printf("Liberty Roleplay: %i doors loaded!", totaldoors);
	        }
	    }
	    case THREAD_CHECK_ACCOUNT:
	    {
	        if(szRows)
	        {
	            new temp[130];

				cache_get_field_content(0, "password", temp);
                format(AccountData[extraid][pPassword], 129, "%s", temp);
                
                cache_get_field_content(0, "registerdate", temp);
                format(AccountData[extraid][pRegisterDate], 128, "%s", temp);
                
                cache_get_field_content(0, "lastlogin", temp);
                format(AccountData[extraid][pLastLogin], 128, "%s", temp);
                
                cache_get_field_content(0, "ip", temp);
                format(AccountData[extraid][pIP], 50, "%s", temp);
                
                cache_get_field_content(0, "bannedby", temp);
                format(AccountData[extraid][pBannedBy], 50, "%s", temp);
                cache_get_field_content(0, "banreason", temp);
                format(AccountData[extraid][pBanReason], 50, "%s", temp);
                cache_get_field_content(0, "bandate", temp);
                format(AccountData[extraid][pBanDate], 50, "%s", temp);

				cache_get_field_content(0, "warrant1", temp);
                format(AccountData[extraid][pWarrant1], 50, "%s", temp);
                cache_get_field_content(0, "warrant2", temp);
                format(AccountData[extraid][pWarrant2], 50, "%s", temp);
                cache_get_field_content(0, "warrant3", temp);
                format(AccountData[extraid][pWarrant3], 50, "%s", temp);
                cache_get_field_content(0, "warrant4", temp);
                format(AccountData[extraid][pWarrant4], 50, "%s", temp);
                cache_get_field_content(0, "warrant5", temp);
                format(AccountData[extraid][pWarrant5], 50, "%s", temp);
                cache_get_field_content(0, "warrant6", temp);
                format(AccountData[extraid][pWarrant6], 50, "%s", temp);

				cache_get_field_content(0, "gender", temp);
				AccountData[extraid][pGender] = strval(temp);
				
				cache_get_field_content(0, "armsdealerskill", temp);
				AccountData[extraid][pArmsDealerSkill] = strval(temp);
				
				cache_get_field_content(0, "newbietog", temp);
				AccountData[extraid][pNewbieToggled] = strval(temp);
				
				cache_get_field_content(0, "hospitalized", temp);
				AccountData[extraid][pHospitalized] = strval(temp);
				
				cache_get_field_content(0, "helper", temp);
				AccountData[extraid][pHelper] = strval(temp);

				cache_get_field_content(0, "stealth", temp);
				AccountData[extraid][pStealth] = strval(temp);
				
				cache_get_field_content(0, "family", temp);
				AccountData[extraid][pFamily] = strval(temp);

                cache_get_field_content(0, "paycheckamount", temp);
				AccountData[extraid][pPayCheckAmount] = strval(temp);

				cache_get_field_content(0, "boughtvehicle", temp);
				AccountData[extraid][pGotVehicle] = strval(temp);
				
				cache_get_field_content(0, "leader", temp);
				AccountData[extraid][pLeader] = strval(temp);

				cache_get_field_content(0, "age", temp);
				AccountData[extraid][pAge] = strval(temp);
				
				cache_get_field_content(0, "paycheck", temp);
				AccountData[extraid][pPayCheck] = strval(temp);
				
				cache_get_field_content(0, "cash", temp);
				AccountData[extraid][pCash] = strval(temp);
				
				cache_get_field_content(0, "bank", temp);
				AccountData[extraid][pBank] = strval(temp);
				
				cache_get_field_content(0, "autologin", temp);
				AccountData[extraid][pAutoLogin] = strval(temp);
				
				cache_get_field_content(0, "musicstream", temp);
				AccountData[extraid][pMusicStreaming] = strval(temp);
				
				cache_get_field_content(0, "banstamp", temp);
				AccountData[extraid][pBanStamp] = strval(temp);
				
				cache_get_field_content(0, "prisoned", temp);
				AccountData[extraid][pPrisoned] = strval(temp);
				
				cache_get_field_content(0, "prisontime", temp);
				AccountData[extraid][pPrisonTime] = strval(temp);
				
				cache_get_field_content(0, "houseID", temp);
				AccountData[extraid][pHouseID] = strval(temp);
				
				cache_get_field_content(0, "factionID", temp);
				AccountData[extraid][pFaction] = strval(temp);
				
				cache_get_field_content(0, "materials", temp);
				AccountData[extraid][pMaterials] = strval(temp);

				cache_get_field_content(0, "crack", temp);
				AccountData[extraid][pCrack] = strval(temp);

				cache_get_field_content(0, "pot", temp);
				AccountData[extraid][pPot] = strval(temp);
				
				cache_get_field_content(0, "wanted", temp);
				AccountData[extraid][pWanted] = strval(temp);
				
				cache_get_field_content(0, "banned", temp);
				AccountData[extraid][pBanned] = strval(temp);
				
				cache_get_field_content(0, "bizID", temp);
				AccountData[extraid][pBizID] = strval(temp);
				
				cache_get_field_content(0, "paycheck", temp);
				AccountData[extraid][pPayCheck] = strval(temp);
				
				cache_get_field_content(0, "jobID", temp);
				AccountData[extraid][pJob] = strval(temp);
				
				cache_get_field_content(0, "respects", temp);
				AccountData[extraid][pRespects] = strval(temp);
				
				cache_get_field_content(0, "level", temp);
				AccountData[extraid][pLevel] = strval(temp);
				
				cache_get_field_content(0, "rank", temp);
				AccountData[extraid][pRank] = strval(temp);
				
				cache_get_field_content(0, "skin", temp);
				AccountData[extraid][pSkin] = strval(temp);
				
				cache_get_field_content(0, "phonebook", temp);
				AccountData[extraid][pPhoneBook] = strval(temp);
				
				cache_get_field_content(0, "adressbook", temp);
				AccountData[extraid][pAdressBook] = strval(temp);
				
				cache_get_field_content(0, "ties", temp);
				AccountData[extraid][pTies] = strval(temp);
				
				cache_get_field_content(0, "phone", temp);
				AccountData[extraid][pPhone] = strval(temp);
				
				cache_get_field_content(0, "facduty", temp);
				AccountData[extraid][pFacDuty] = strval(temp);
				
				cache_get_field_content(0, "phonenumber", temp);
				AccountData[extraid][pPhoneNumber] = strval(temp);
				
				cache_get_field_content(0, "adminlevel", temp);
				AccountData[extraid][pAdmin] = strval(temp);
				cache_get_field_content(0, "interior", temp);
				AccountData[extraid][pInt] = strval(temp);
				cache_get_field_content(0, "virtualworld", temp);
				AccountData[extraid][pVW] = strval(temp);
				cache_get_field_content(0, "positionx", temp);
				AccountData[extraid][pPosition][0] = floatstr(temp);
				cache_get_field_content(0, "positiony", temp);
				AccountData[extraid][pPosition][1] = floatstr(temp);
				cache_get_field_content(0, "positionz", temp);
				AccountData[extraid][pPosition][2] = floatstr(temp);
				cache_get_field_content(0, "positiona", temp);
				AccountData[extraid][pPosition][3] = floatstr(temp);
				cache_get_field_content(0, "health", temp);
				AccountData[extraid][pHealth] = floatstr(temp);
				cache_get_field_content(0, "armor", temp);
				AccountData[extraid][pArmor] = floatstr(temp);

				CheckBan(extraid);
				SpawnPlayerVehicle(extraid, 1);
				
				if(AccountData[extraid][pAutoLogin] == 0)
				{
					LoginPlayerDialog(extraid);
				}
				else
				{
					AutoLoginPlayer(extraid);
				}
	        }
	        else if(!szRows)
	        {
	            new ip[17], query[100];
	            
	            GetPlayerIp(extraid, ip, sizeof(ip));
	            format(query, sizeof(query), "SELECT * FROM `Banned` WHERE `BannedIP` = '%s'", ip);
	            mysql_function_query(MainPipeline, query, true, "CheckBanz", "iis", THREAD_LOAD_BANS_IP, extraid, ip);
	        
				format(szOutput, sizeof(szOutput), "{FFFFFF}Hello, welcome to "SERVER_NAME"! We have found you are not registered.\n\n[Username]: {E3DD3B}%s{FFFFFF} - [IP]: {E3DD3B}%s{FFFFFF}\n\nIt seems you are not registered, enter a password below to do-so!", ReturnPlayerName(extraid), ip);
		        ShowPlayerDialog(extraid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "{42C2F5}["SERVER_NAME": {FFFFFF}Login{42C2F5}]", szOutput, "Register", "Quit");
	        }
	    }
	}
	return 1;
}
Reply
#9

*BUMP* , Who can help me ? And complete his help. Plz
Reply
#10

To show your PAWN code like it is use the PAWN-tags.

pawn Код:
[.PAWN] /* CODE HERE */ [./PAWN] //Remove the dots
You need to wait 24h in order to bump your topic.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)