Why it's not working anymore? EditObject - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Why it's not working anymore? EditObject (
/showthread.php?tid=649210)
Why it's not working anymore? EditObject -
binnyl - 04.02.2018
I have this system to create ATMs ingame:
PHP код:
CMD:makeatm(playerid, params[]) {
new atmid, name[30];
if(sscanf(params,"is[30]", atmid, name)) return SendClientMessage(playerid, -1, "Use: /makeatm [id] [name]");
if(atmid < 1 && atmid > MAX_ATMS) return SendClientMessage(playerid, -1, "Choose a number between 1-MAX_ATMS");
new Float:x, Float:y, Float:z, Float:vA;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, vA);
AtmInfo[atmid][atmX] = x;
AtmInfo[atmid][atmY] = y;
AtmInfo[atmid][atmZ] = z;
AtmInfo[atmid][atmName] = name;
CreatingATMObject[playerid] = atmid;
ATMobject[atmid] = CreateObject(2942, x + (1.0 * floatsin(-vA, degrees)), y + (1.0 * floatcos(-vA, degrees)), z, 0.0, 0.0, 0.0);
EditObject(playerid, ATMobject[atmid]);
return 1;
}
I was working, but today i tried to create a ATM and nothing happen, nothing pritting on server.log
Anybody know what could be?
Re: Why it's not working anymore? EditObject -
JasonRiggs - 04.02.2018
Maybe the object is created as "createdynamicobject" and u are using EditObject not EditDynamicObject..
Re: Why it's not working anymore? EditObject -
YouAlreadyKnowWhoItIs - 04.02.2018
Shouldnt the floatsin and floatcos code be put in the angle section? This might be the issue, your ATM is probably appearing far away from where it was initially created.
Re: Why it's not working anymore? EditObject -
Mugala - 04.02.2018
for first, you don't need this cosinus and sinus functions.
make sure that object is created in player range.
Re: Why it's not working anymore? EditObject -
binnyl - 05.02.2018
Quote:
Originally Posted by JasonRiggs
Maybe the object is created as "createdynamicobject" and u are using EditObject not EditDynamicObject..
|
It was it
+rep