I had done something like this a long time ago and it worked to create that object in any position where I marked on the map but I do not remember how I had done it the first time, I made this attempt but the object is always created in the 0.0.0.0.0.0 coordinate some idea?
Code:
public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
{
if(GetPlayerWeapon(playerid) == 0)
{
new Float:x, Float:y;
SetPlayerPosFindZ(playerid, fX, fY, fZ);
Obj[playerid]=CreateObject(1274, x, y, fZ, 0.0, 0.0, 0.0);
}