Jump to content

Snz

Membru
  • Posts

    10
  • Joined

  • Last visited

Posts posted by Snz

  1. Primesc aceste erori(nu stiu cum sa rezolv..):

    In callback "LoadHoldDetails"
    14:03:29	cache_get_field_content	OK	row: 0, field_name: "Obj1", connection: 1, max_len: 1024
    14:03:29	CMySQLResult::GetRowDataByName()	ERROR	invalid row index ('0')
    14:03:29	cache_get_field_content	OK	row: 0, field_name: "Obj2", connection: 1, max_len: 1024
    14:03:29	CMySQLResult::GetRowDataByName()	ERROR	invalid row index ('0')
    14:03:29	cache_get_field_content	OK	row: 0, field_name: "Obj3", connection: 1, max_len: 1024
    14:03:29	CMySQLResult::GetRowDataByName()	ERROR	invalid row index ('0')
    14:03:29	cache_get_field_content	OK	row: 0, field_name: "Obj4", connection: 1, max_len: 1024
    14:03:29	CMySQLResult::GetRowDataByName()	ERROR	invalid row index ('0')
    14:03:29	cache_get_field_content	OK	row: 0, field_name: "Obj5", connection: 1, max_len: 1024
    14:03:29	CMySQLResult::GetRowDataByName()	ERROR	invalid row index ('0')
    14:03:29	cache_get_field_content	OK	row: 0, field_name: "Obj6", connection: 1, max_len: 1024
    14:03:29	CMySQLResult::GetRowDataByName()	ERROR	invalid row index ('0')
    14:03:29	cache_get_field_content	OK	row: 0, field_name: "Obj7", connection: 1, max_len: 1024
    14:03:29	CMySQLResult::GetRowDataByName()	ERROR	invalid row index ('0')
    14:03:29	cache_get_field_content	OK	row: 0, field_name: "Obj8", connection: 1, max_len: 1024
    14:03:29	CMySQLResult::GetRowDataByName()	ERROR	invalid row index ('0')
    14:03:29	cache_get_field_content	OK	row: 0, field_name: "Obj9", connection: 1, max_len: 1024
    14:03:29	CMySQLResult::GetRowDataByName()	ERROR	invalid row index ('0')
    14:03:29	cache_get_field_content	OK	row: 0, field_name: "Obj10", connection: 1, max_len: 1024
    14:03:29	CMySQLResult::GetRowDataByName()	ERROR	invalid row index ('0')

    La LoadHoldDetails am in felul urmator:

    function LoadHoldDetails(playerid)
    {
    	if ( !IsPlayerConnected( playerid ) )
    	    return ( 1 );
    	    
    	new szField[1024], Z, count_attach[ MAX_PLAYERS ], gsString[4096];
    	eString[0] = EOS; eQuery[0] = EOS;
    	for ( new a = 0; a < MAX_PLAYER_ATTACHED_OBJECTS; a++ )
    	{
    	    format( gsString, 20, "Obj%d", a + 1 );
    	    cache_get_field_content( 0, gsString, szField, DB_Connect );
    
    	    sscanf( szField, "p<,>iiifffffffff", Z, Attach_Info[ playerid ][ a ][ ao_model ], Attach_Info[ playerid ][ a ][ ao_bone ],
    	    Attach_Info[ playerid ][ a ][ ao_x ], Attach_Info[ playerid ][ a ][ ao_y ], Attach_Info[ playerid ][ a ][ ao_z ],
    	    Attach_Info[ playerid ][ a ][ ao_rx ], Attach_Info[ playerid ][ a ][ ao_ry ], Attach_Info[ playerid ][ a ][ ao_rz ],
    	    Attach_Info[ playerid ][ a ][ ao_sx ], Attach_Info[ playerid ][ a ][ ao_sy ], Attach_Info[ playerid ][ a ][ ao_sz ] );
    
    		if ( Attach_Info[ playerid ][ Z ][ ao_model ] != 0 )
    			count_attach[ playerid ]++;
    	}
    	if ( count_attach[ playerid ] > 0 )
    		PlayerInfo[ playerid ][ Use_Attach ] = 1;
    
    	for ( new v_obj = 0; v_obj < MAX_VEHICLE_ATTACHED_OBJECTS; v_obj++ )
    	{
    	    format( gsString, 10, "v_Obj%d", v_obj + 1 );
    	    cache_get_field_content( 0, gsString, szField, DB_Connect );
    
    	    sscanf( szField, "p<,>iffffff", V_Attach[ playerid ][ v_obj ][ liModel ],
    		V_Attach[ playerid ][ v_obj ][ lfVO_X ], V_Attach[ playerid ][ v_obj ][ lfVO_Y ], V_Attach[ playerid ][ v_obj ][ lfVO_Z ],
    		V_Attach[ playerid ][ v_obj ][ lfVO_RX ], V_Attach[ playerid ][ v_obj ][ lfVO_RY ], V_Attach[ playerid ][ v_obj ][ lfVO_RZ ] );
    
    		if ( V_Attach[ playerid ][ v_obj ][ liModel ] != -1 )
            	p_Object[ playerid ][ v_obj ] = CreateDynamicObject( V_Attach[ playerid ][ v_obj ][ liModel ], 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, playerid );
    
    		PlayerInfo[ playerid ][ TunedVehicle ] = cache_get_field_content_int( 0, "Vehicle_ID", DB_Connect );
    	}
    	if (PlayerInfo[playerid][p_HoldSaving] == 1)
    	{
    		for (new i = 0; i < MAX_PLAYER_ATTACHED_OBJECTS; i++)
    		{
    			if (i != MAX_PLAYER_ATTACHED_OBJECTS - 1)
    			{
    				format(eQuery, 1024, "INSERT INTO `Holds` (Obj%d) VALUES ('%d,%d,%d,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f,%.2f')", i+1, i, Attach_Info[ playerid ][ i ][ ao_model ], Attach_Info[ playerid ][ i ][ ao_bone ], Attach_Info[ playerid ][ i ][ ao_x ], Attach_Info[ playerid ][ i ][ ao_y ], Attach_Info[ playerid ][ i ][ ao_z ], Attach_Info[ playerid ][ i ][ ao_rx ], Attach_Info[ playerid ][ i ][ ao_ry ], Attach_Info[ playerid ][ i ][ ao_rz ], Attach_Info[ playerid ][ i ][ ao_sx ], Attach_Info[ playerid ][ i ][ ao_sy ], Attach_Info[ playerid ][ i ][ ao_sz ] );
    			}
    		}
    		format(eQuery, 1024, "%s WHERE `UserID` = %d", eQuery, PlayerInfo[playerid][AccID]);
    		mysql_tquery(DB_Connect, eQuery, "", "");
        }
    	return ( 1 );
    }

     

  2. Problema intalnita (descriere): Nu se creeaza in baza de date aceste informatii: http://prntscr.com/7x6and , http://prntscr.com/7x6aqi
    Ero(area / rile) / warning-(ul / urile):

    [16:24:23] ====================================================
    [16:24:23] Error ID: 1064
    Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(Obj2) VALUES (1,0,0,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00) (Obj3) VALUES' at line 1
    Callback: 
    Query: INSERT INTO `Holds` (Obj1) VALUES (0,0,0,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00) (Obj2) VALUES (1,0,0,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00) (Obj3) VALUES (2,0,0,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00) (Obj4) VALUES (3,0,0,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00) (Obj5) VALUES (4,0,0,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00) (Obj6) VALUES (5,0,0,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00) (Obj7) VALUES (6,0,0,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00) (Obj8) VALUES (7,0,0,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00) (Obj9) VALUES (8,0,0,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00) (Obj10) VALUES (9,0,0,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00)
    [16:24:23] ====================================================
    

    Liniile de cod / sursa / script-ul(obligatoriu):

    	if(PlayerInfo[playerid][p_HoldSaving] == 1)
    	{
    	    format(eQuery, sizeof(eQuery), "INSERT INTO `Holds`");
    	    for(new i = 0; i < MAX_PLAYER_ATTACHED_OBJECTS; i++)
    	    {
    	        if ( i != MAX_PLAYER_ATTACHED_OBJECTS - 1 )
    	        {
    		    	format(eQuery, sizeof(eQuery), "%s (Obj%d) VALUES (%d,%d,%d,%.2f,%.2f,%.2f,%.2f", eQuery, i + 1, i, Attach_Info[ playerid ][ i ][ ao_model ], Attach_Info[ playerid ][ i ][ ao_bone ], Attach_Info[ playerid ][ i ][ ao_x ], Attach_Info[ playerid ][ i ][ ao_y ], Attach_Info[ playerid ][ i ][ ao_z ], Attach_Info[ playerid ][ i ][ ao_rx ]);
    				format(eQuery, sizeof(eQuery), "%s,%.2f,%.2f,%.2f,%.2f,%.2f)", eQuery, Attach_Info[ playerid ][ i ][ ao_ry ], Attach_Info[ playerid ][ i ][ ao_rz ], Attach_Info[ playerid ][ i ][ ao_sx ], Attach_Info[ playerid ][ i ][ ao_sy ], Attach_Info[ playerid ][ i ][ ao_sz ] );
    			}
    			else
    			{
    				format(eQuery, sizeof(eQuery), "%s (Obj%d) VALUES (%d,%d,%d,%.2f,%.2f,%.2f,%.2f", eQuery, i+1, i, Attach_Info[ playerid ][ i ][ ao_model ], Attach_Info[ playerid ][ i ][ ao_bone ], Attach_Info[ playerid ][ i ][ ao_x ], Attach_Info[ playerid ][ i ][ ao_y ], Attach_Info[ playerid ][ i ][ ao_z ], Attach_Info[ playerid ][ i ][ ao_rx ]);
    				format(eQuery, sizeof(eQuery), "%s,%.2f,%.2f,%.2f,%.2f,%.2f)", eQuery, Attach_Info[ playerid ][ i ][ ao_ry ], Attach_Info[ playerid ][ i ][ ao_rz ], Attach_Info[ playerid ][ i ][ ao_sx ], Attach_Info[ playerid ][ i ][ ao_sy ], Attach_Info[ playerid ][ i ][ ao_sz ] );
    			}
    		}
    		mysql_tquery(Connect, eQuery, "", "");
    	}
    

    Imagini / Video (optional): -
    Ati incercat sa rezolvati singur?: Aveam la callback-ul SavePlayer, liniile care dadeau update , atunci cand un player iesea de pe sv sa modifice ce holduri avea. Dar, eu nu aveam insert into, deci update-ul era de pomana. Asa ca l-am creeat. Dar am acele erori.. Ma ajutat si Wopss cu ce a putut, mi-a dat sfaturi, dar tot nu am reusit, si cu ajutorul la wiki..

  3. settings.ini din folderul de la pawno.

    Pune setarile astea:

    [General]
    FileAssoc=0
    [Display]
    WindowMax=1
    WindowX=321
    WindowY=293
    WindowW=622
    WindowH=379
    Splitter=308
    Font_Name=Courier New
    Font_Size=10
    ShowFuncList=0
    [RunOpts]
    CopyDir=\
    ExeFile=pawncc.exe
    Params=-r -w 203
  4. Ramane lafel ca inainte, nu scade timp-ul

    Comanda:

    CMD:freeze(playerid, params[])
    {
        if(PlayerInfo[playerid][Level] < 2) return SendError(playerid, "You need to be Admin Level 2 to use this command!");
        //--------------------------------------------------------------------------
        new liPlayer, liTime, Reason[50]; eString[0] = EOS;
        //--------------------------------------------------------------------------
        if(sscanf(params, "uiS(No Reason)[50]", liPlayer, liTime, Reason)) return
    	SendUsage(playerid, "/freeze [PlayerID] [Freeze Time] [Reason]");
    	//--------------------------------------------------------------------------
        if(!IsPlayerConnected(liPlayer)) return
    	SendError(playerid, "Player not connected.");
    	//--------------------------------------------------------------------------
        if(PlayerInfo[liPlayer][Frozen] == 1) return
    	SendError(playerid, "Player is already frozen!");
    	//--------------------------------------------------------------------------
        if(liTime > 9999) return
    	SendError(playerid, "Invalid Time!");
        //--------------------------------------------------------------------------
        TogglePlayerControllable(liPlayer, false),	SetPlayerVirtualWorld(liPlayer, 10);
        PlayerInfo[liPlayer][Frozen] = 1,			PlayerPlaySound(liPlayer, 1057, 0.0, 0.0, 0.0);
    	fTime[liPlayer][0] = liTime*60,				fTime[liPlayer][1] = 60;
    	new Str[80];
    	format(Str, sizeof(Str), "%d:%d",liTime/60,liTime);
     	TextDrawSetString(Textdraw7, Str);
     	new Str2[80];
     	format(Str2, sizeof(Str2), "%s", PlayerName(playerid));
     	TextDrawSetString(Textdraw11, Str2);
      	TextDrawShowForPlayer(liPlayer, Textdraw0);
     	TextDrawShowForPlayer(liPlayer, Textdraw1);
      	TextDrawShowForPlayer(liPlayer, Textdraw2);
      	TextDrawShowForPlayer(liPlayer, Textdraw3);
      	TextDrawShowForPlayer(liPlayer, Textdraw4);
      	TextDrawShowForPlayer(liPlayer, Textdraw5);
       	TextDrawShowForPlayer(liPlayer, Textdraw6);
      	TextDrawShowForPlayer(liPlayer, Textdraw7);
      	TextDrawShowForPlayer(liPlayer, Textdraw8);
      	TextDrawShowForPlayer(liPlayer, Textdraw9);
       	TextDrawShowForPlayer(liPlayer, Textdraw10);
      	TextDrawShowForPlayer(liPlayer, Textdraw11);
        //--------------------------------------------------------------------------
    	SetTimerEx("ShowFreezeLeftTime", 1000, 0, "i", liPlayer);
        //--------------------------------------------------------------------------
        format(eString, sizeof(eString), "Co-Owner {FF0000}%s{D1D1D1} la inghetat pe {00A6FF}%s {D1D1D1}pentru {00A6FF}%d {D1D1D1}minute.(Motiv: %s)", PlayerName(playerid), PlayerName(liPlayer), liTime, Reason);
        SendClientMessageToAll(COLOR_GREY2, eString);
        //--------------------------------------------------------------------------
        return 1;
    }

    Iar timer-ul in care am pus:

    fTime[liPlayer][0]--;

    Este:

    function ShowFreezeLeftTime(szPlayer)
    {
    	new liPlayer;
    	if(!IsPlayerConnected(szPlayer)) return 0;
    	//--------------------------------------------------------------------------
        if(fTime[szPlayer][0] < 0 && fTime[szPlayer][1] > 0)
        {
    		if(PlayerInfo[szPlayer][Frozen] == 1) UnFreezeMe(szPlayer);
    	}
    	else SetTimerEx("ShowFreezeLeftTime", 1000, 0, "i", szPlayer);
        //--------------------------------------------------------------------------
    	fTime[szPlayer][1]--;
    	fTime[liPlayer][0] --; //aceasta e linia
    	//--------------------------------------------------------------------------
    	if(fTime[szPlayer][1] == 0) fTime[szPlayer][0]--, fTime[szPlayer][1] = 60;
    	//--------------------------------------------------------------------------
        return 1;
    }
  5. Problema intalnita (descriere): Am incercat sa fac la comanda /freeze un textdraw care arata de la cine ai primit freeze si timpul ramas.

    Timpul mi-l arata, ex: /freeze 0 2 Test , 0 fiind id-ul si 2 minutele. In textdraw apare Timp ramas: 2 ,  si la Admin Name lafel, apare de la cine ai primit freeze. Problema e ca nu reusesc sa il fac in secunde. Daca ii dau unui player 10 minute jail, sa inceapa sa scada, 9:59, 9:58 pana la 0 cand va lua unfreeze.
    Ero(area / rile) / warning-(ul / urile): - 
    Liniile de cod / sursa / script-ul(obligatoriu):

    CMD:freeze(playerid, params[])
    {
        if(PlayerInfo[playerid][Level] < 2) return SendError(playerid, "You need to be Admin Level 2 to use this command!");
        //--------------------------------------------------------------------------
        new liPlayer, liTime, Reason[50]; eString[0] = EOS;
        //--------------------------------------------------------------------------
        if(sscanf(params, "uiS(No Reason)[50]", liPlayer, liTime, Reason)) return
    	SendUsage(playerid, "/freeze [PlayerID] [Freeze Time] [Reason]");
    	//--------------------------------------------------------------------------
        if(!IsPlayerConnected(liPlayer)) return
    	SendError(playerid, "Player not connected.");
    	//--------------------------------------------------------------------------
        if(PlayerInfo[liPlayer][Frozen] == 1) return
    	SendError(playerid, "Player is already frozen!");
    	//--------------------------------------------------------------------------
        if(liTime > 9999) return
    	SendError(playerid, "Invalid Time!");
        //--------------------------------------------------------------------------
        TogglePlayerControllable(liPlayer, false),	SetPlayerVirtualWorld(liPlayer, 10);
        PlayerInfo[liPlayer][Frozen] = 1,			PlayerPlaySound(liPlayer, 1057, 0.0, 0.0, 0.0);
    	fTime[liPlayer][0] = liTime-1,				fTime[liPlayer][1] = 60;
    	new Str[80];
    	format(Str, sizeof(Str), "%d:%d",liTime/60,liTime-liTime/60*60);
     	TextDrawSetString(Textdraw7, Str);
     	new Str2[80];
     	format(Str2, sizeof(Str2), "%s", PlayerName(playerid));
     	TextDrawSetString(Textdraw11, Str2);
      	TextDrawShowForPlayer(liPlayer, Textdraw0);
     	TextDrawShowForPlayer(liPlayer, Textdraw1);
      	TextDrawShowForPlayer(liPlayer, Textdraw2);
      	TextDrawShowForPlayer(liPlayer, Textdraw3);
      	TextDrawShowForPlayer(liPlayer, Textdraw4);
      	TextDrawShowForPlayer(liPlayer, Textdraw5);
       	TextDrawShowForPlayer(liPlayer, Textdraw6);
      	TextDrawShowForPlayer(liPlayer, Textdraw7);
      	TextDrawShowForPlayer(liPlayer, Textdraw8);
      	TextDrawShowForPlayer(liPlayer, Textdraw9);
       	TextDrawShowForPlayer(liPlayer, Textdraw10);
      	TextDrawShowForPlayer(liPlayer, Textdraw11);
        //--------------------------------------------------------------------------
    	SetTimerEx("ShowFreezeLeftTime", 1000, 0, "i", liPlayer);
        //--------------------------------------------------------------------------
        format(eString, sizeof(eString), "Co-Owner {FF0000}%s{D1D1D1} la inghetat pe {00A6FF}%s {D1D1D1}pentru {00A6FF}%d {D1D1D1}minute.(Motiv: %s)", PlayerName(playerid), PlayerName(liPlayer), liTime, Reason);
        SendClientMessageToAll(COLOR_GREY2, eString);
        //--------------------------------------------------------------------------
        return 1;
    }
    

    Imagini / Video (optional): "10" acela sunt minutele http://prntscr.com/7vnq1s
    Ati incercat sa rezolvati singur?: Desigur, am incercat sa folosesc un timer, dar de geaba..

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.