Jump to content

Recommended Posts

Posted

Salut.

public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rxs, Float:rys, Float:rzs)
{

	if(objectid == AtmulCelFaimos[playerid])
	{
	    new query[1000];
	    new i = atms+1;
	    new vw, int;
	    vw = GetPlayerVirtualWorld(playerid);
	    int = GetPlayerInterior(playerid);
	    if(response == 0)
	    {
	        CancelEdit(playerid);
		    DestroyDynamicObject(AtmulCelFaimos[playerid]);
		    SCM(playerid, COLOR_TEAL, "You canceled.");
	    }
	    if(response == 1)
	    {
	        SCM(playerid, COLOR_TEAL, "Atmul a fost adaugat cu succes.");
	        mysql_format(SQL, query, sizeof(query), "INSERT INTO `ATMS`(`ID`, `PosX`, `PosY`, `PosZ`, `RotX`, `RotY`, `RotZ`, `VW`, `Interior`) VALUES ('%d', '%f', '%f', '%f', '%f', '%f', '%f', '%d', '%d')", i, x, y, z, rxs, rys, rzs, vw, int);
			mysql_tquery(SQL,query,"","");

			SetDynamicObjectPos(AtmulCelFaimos[playerid], x, y, z);
			SetDynamicObjectRot(AtmulCelFaimos[playerid], rxs, rys, rzs);

			AtmInfo[i][aID] = i;
			AtmInfo[i][aPosX] = x;
			AtmInfo[i][aPosY] = y;
			AtmInfo[i][aPosZ] = z;
            AtmInfo[i][aRotX] = rxs;
            AtmInfo[i][aRotY] = rys;
            AtmInfo[i][aRotZ] = rzs;
            AtmInfo[i][aVW] = vw;
            AtmInfo[i][aInt] = int;

            AtmInfo[i][onSV] = AtmulCelFaimos[playerid];
            ATMZONE[i] = CreateDynamicCube(AtmInfo[i][aPosX], AtmInfo[i][aPosY], AtmInfo[i][aPosZ], AtmInfo[i][aPosX]+5, AtmInfo[i][aPosY]+5, AtmInfo[i][aPosZ]+5, AtmInfo[i][aVW], AtmInfo[i][aInt]);
            new text[512];
			format(text, sizeof(text), "{FFFFFF} ATM {B30000}ID{FFFFFF}: %d\n{FFFFFF}Type /atm to withdraw or deposit your money", i);
			ATMLABEL[i] = CreateDynamic3DTextLabel(text, -1,AtmInfo[i][aPosX], AtmInfo[i][aPosY], AtmInfo[i][aPosZ]+1, 5.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, AtmInfo[i][aVW], AtmInfo[i][aInt], -1, 200.0, ATMZONE[i], 0);
	    }
	    if(response == 2)
    	{
        	SetDynamicObjectPos(objectid, x, y, z);
			SetDynamicObjectRot(objectid, rxs, rys, rzs);
    	}

	}

	return 1;
}

Si primesc o eroare de genu

C:\Users\metin\OneDrive\Desktop\Gamemode\gamemodes\mozzila.pwn(51349) : error 025: function heading differs from prototype

 

care ca nu inteleg?

mai tare e bigzone

Posted
6 hours ago, DaNl said:

care este randul 51349?

public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rxs, Float:rys, Float:rzs)

mai tare e bigzone

Posted
Acum 51 minute, RebornAdv a spus:

public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rxs, Float:rys, Float:rzs)

public ul este diferit de forward.

App vezi ca acel query de 1000 este mult prea mare. cred ca 350 este destul.

Posted
Acum 8 ore, RebornAdv a spus:

public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rxs, Float:rys, Float:rzs) { if(objectid == AtmulCelFaimos[playerid]) { new query[1000]; new i = atms+1; new vw, int; vw = GetPlayerVirtualWorld(playerid); int = GetPlayerInterior(playerid); if(response == 0) { CancelEdit(playerid); DestroyDynamicObject(AtmulCelFaimos[playerid]); SCM(playerid, COLOR_TEAL, "You canceled."); } if(response == 1) { SCM(playerid, COLOR_TEAL, "Atmul a fost adaugat cu succes."); mysql_format(SQL, query, sizeof(query), "INSERT INTO `ATMS`(`ID`, `PosX`, `PosY`, `PosZ`, `RotX`, `RotY`, `RotZ`, `VW`, `Interior`) VALUES ('%d', '%f', '%f', '%f', '%f', '%f', '%f', '%d', '%d')", i, x, y, z, rxs, rys, rzs, vw, int); mysql_tquery(SQL,query,"",""); SetDynamicObjectPos(AtmulCelFaimos[playerid], x, y, z); SetDynamicObjectRot(AtmulCelFaimos[playerid], rxs, rys, rzs); AtmInfo[i][aID] = i; AtmInfo[i][aPosX] = x; AtmInfo[i][aPosY] = y; AtmInfo[i][aPosZ] = z; AtmInfo[i][aRotX] = rxs; AtmInfo[i][aRotY] = rys; AtmInfo[i][aRotZ] = rzs; AtmInfo[i][aVW] = vw; AtmInfo[i][aInt] = int; AtmInfo[i][onSV] = AtmulCelFaimos[playerid]; ATMZONE[i] = CreateDynamicCube(AtmInfo[i][aPosX], AtmInfo[i][aPosY], AtmInfo[i][aPosZ], AtmInfo[i][aPosX]+5, AtmInfo[i][aPosY]+5, AtmInfo[i][aPosZ]+5, AtmInfo[i][aVW], AtmInfo[i][aInt]); new text[512]; format(text, sizeof(text), "{FFFFFF} ATM {B30000}ID{FFFFFF}: %d\n{FFFFFF}Type /atm to withdraw or deposit your money", i); ATMLABEL[i] = CreateDynamic3DTextLabel(text, -1,AtmInfo[i][aPosX], AtmInfo[i][aPosY], AtmInfo[i][aPosZ]+1, 5.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, AtmInfo[i][aVW], AtmInfo[i][aInt], -1, 200.0, ATMZONE[i], 0); } if(response == 2) { SetDynamicObjectPos(objectid, x, y, z); SetDynamicObjectRot(objectid, rxs, rys, rzs); } } return 1; }

poftim funcția corecta cum ai făcut tu nu o stai meargă bafta.

public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)
{
    new Float:oldX, Float:oldY, Float:oldZ,
    Float:oldRotX, Float:oldRotY, Float:oldRotZ;

    GetDynamicObjectPos(objectid, oldX, oldY, oldZ);
    GetDynamicObjectRot(objectid, oldRotX, oldRotY, oldRotZ);

    if(response == EDIT_RESPONSE_FINAL)
    {
        SetDynamicObjectPos(objectid, x, y, z);
        SetDynamicObjectRot(objectid, rz, ry, rz);
    }

    if(response == EDIT_RESPONSE_CANCEL)
    {
        SetDynamicObjectPos(objectid, oldX, oldY, oldZ);
        SetDynamicObjectRot(objectid, oldRotX, oldRotY, oldRotZ);
    }


    printf("%d, %d", EDIT_RESPONSE_FINAL, response);
    return 1;
}

 

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.