if(sscanf(params, "iffffffii", ObjectInfo[o][oModel], ObjectInfo[o][oX], ObjectInfo[o][oY], ObjectInfo[o][oZ], ObjectInfo[o][oRX], ObjectInfo[o][oRY], ObjectInfo[o][oRZ], ObjectInfo[o][oVW], ObjectInfo[o][oInt]))
return SendClientMessage(playerid, COLOR_WHITE, "Usage: /cObject [ModelID] [Position:X] [Position:Y] [Position:Z] [Rotation:X] [Rotation:Y] [Rotation:Z] [VirtualWorldID] [InteriorID]");
cmd:cObject(playerid, params[])
{
if(sscanf(params, "iffffffii", ObjectInfo[o][oModel], ObjectInfo[o][oX], ObjectInfo[o][oY], ObjectInfo[o][oZ], ObjectInfo[o][oRX], ObjectInfo[o][oRY], ObjectInfo[o][oRZ], ObjectInfo[o][oVW], ObjectInfo[o][oInt]))
return SendClientMessage(playerid, COLOR_WHITE, "Usage: /cObject [ModelID] [Position:X] [Position:Y] [Position:Z] [Rotation:X] [Rotation:Y] [Rotation:Z] [VirtualWorldID] [InteriorID]");
CreateDynamicObject(ObjectInfo[o][oModel], ObjectInfo[o][oX],ObjectInfo[o][oY],ObjectInfo[o][oZ], ObjectInfo[o][oRX],ObjectInfo[o][oRY],ObjectInfo[o][oRZ], ObjectInfo[o][oVW], ObjectInfo[o][oInt]);
return 1;
}
Are you using latest sscanf? if no then consider using it because I have just tested that and it worked perfectly.
https://sampforum.blast.hk/showthread.php?tid=602923 |
I have just downloaded the latest sscanf, but still this problem, try to type:
/cobject 693 -1432.66492 299.67242 11.42419 0.00000 0.00000 0.00000 -1 -1 It is creating the object to coordinates: 0.000000, 299.672424, 11.42419, 0, 0, 0 |
#include a_samp
#include sscanf2
public OnFilterScriptInit()
{
new value1, Float:floats[6], twoint[2];
sscanf("693 -1432.66492 299.67242 11.42419 0.00000 0.00000 0.00000 -1 -1", "iffffffii", value1, floats[0], floats[1], floats[2], floats[3], floats[4], floats[5], twoint[0], twoint[1]);
printf("| %d | %f | %f | %f | %f | %f | %f | %d | %d |", value1, floats[0], floats[1], floats[2], floats[3], floats[4], floats[5], twoint[0], twoint[1]);
}
cmd:cObject(playerid, params[]) { new model,x,y,z,rx,ry,rz,vw,in; if(sscanf(params, "iiiiiiiii", model,x,y,z,rx,rx,rz,vw,in)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /cObject [ModelID] [Position:X] [Position:Y] [Position:Z] [Rotation:X] [Rotation:Y] [Rotation:Z] [VirtualWorldID] [InteriorID]"); ObjectInfo[o][oModel] = model; ObjectInfo[o][oX] = float(x); ObjectInfo[o][oY] = float(y); ObjectInfo[o][oZ] = float(z); ObjectInfo[o][oRX] = float(rx); ObjectInfo[o][oRY] = float(ry); ObjectInfo[o][oRZ] = float(rz); ObjectInfo[o][oVW] = vw; ObjectInfo[o][oInt] = in; CreateDynamicObject(ObjectInfo[o][oModel], ObjectInfo[o][oX],ObjectInfo[o][oY],ObjectInfo[o][oZ], ObjectInfo[o][oRX],ObjectInfo[o][oRY],ObjectInfo[o][oRZ], ObjectInfo[o][oVW], ObjectInfo[o][oInt]); return 1; }
Are you sure about that? [ I have just did another test, and see result by yourself. ]
![]() code used: PHP код:
|
Myb try something like this:
Код:
cmd:cObject(playerid, params[]) { new model,x,y,z,rx,ry,rz,vw,in; if(sscanf(params, "iiiiiiiii", model,x,y,z,rx,rx,rz,vw,in)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /cObject [ModelID] [Position:X] [Position:Y] [Position:Z] [Rotation:X] [Rotation:Y] [Rotation:Z] [VirtualWorldID] [InteriorID]"); ObjectInfo[o][oModel] = model; ObjectInfo[o][oX] = float(x); ObjectInfo[o][oY] = float(y); ObjectInfo[o][oZ] = float(z); ObjectInfo[o][oRX] = float(rx); ObjectInfo[o][oRY] = float(ry); ObjectInfo[o][oRZ] = float(rz); ObjectInfo[o][oVW] = vw; ObjectInfo[o][oInt] = in; CreateDynamicObject(ObjectInfo[o][oModel], ObjectInfo[o][oX],ObjectInfo[o][oY],ObjectInfo[o][oZ], ObjectInfo[o][oRX],ObjectInfo[o][oRY],ObjectInfo[o][oRZ], ObjectInfo[o][oVW], ObjectInfo[o][oInt]); return 1; } |
ObjectInfo[o][oX] = float(x);