FANDOM


Ovaj callback se poziva kada igrac napusti "Object Edition" Mod.

Parametri

(playerid, playerobject, objectid, response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ)
playerid - ID igraca koji koristi ovaj callback
playerobject - o ako je global object, 1 ako je player object
objectid - ID uredjenog objekta
response - Tip poziva
Float:fX - X koordinata objekta
Float:fY - Y koordinata objekta
Float:fZ - Z koordinata objekta
Float:fRotX - X Rotacija objekta
Float:fRotY - Y Rotacija objekta
Float:fRotZ - Z Rotacija objekta
Return - Ovaj callback ne zahteva return

Primer Edit

public OnPlayerEditObject(playerid, playerobject, objectid, response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ)
{
	new Float:oldX, Float:oldY, Float:oldZ,
		Float:oldRotX, Float:oldRotY, Float:oldRotZ;
	GetObjectPos(objectid, oldX, oldY, oldZ);
	GetObjectRot(objectid, oldRotX, oldRotY, oldRotZ);
	if(!playerobject) // Ovo je global object
	{
	    if(!IsValidObject(objectid)) return;
	    MoveObject(objectid, fX, fY, fZ, 10.0, fRotX, fRotY, fRotZ);
	}
 
	if(response == EDIT_RESPONSE_FINAL)
	{
		// Igrac je kliknuo na Save Ikonu
		// Bilo sta sa cuvanjem pozicije
	}
 
	if(response == EDIT_RESPONSE_CANCEL)
	{
		//Igrac je izasao tako da vracamo objekat na pocetno mesto
		if(!playerobject) //Objekat nije playerobject
		{
			SetObjectPos(objectid, oldX, oldY, oldZ);
			SetObjectRot(objectid, oldRotX, oldRotY, oldRotZ);
		}
		else
		{
			SetPlayerObjectPos(playerid, objectid, oldX, oldY, oldZ);
			SetPlayerObjectRot(playerid, objectid, oldRotX, oldRotY, oldRotZ);
		}
	}
}

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.