SA-MP Forums Archive
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(playeridparams[]) {
    new 
atmidname[30];
    if(
sscanf(params,"is[30]"atmidname)) return SendClientMessage(playerid, -1"Use: /makeatm [id] [name]");
    if(
atmid && atmid MAX_ATMS) return SendClientMessage(playerid, -1"Choose a number between 1-MAX_ATMS");
    new 
Float:xFloat:yFloat:zFloat:vA;
    
GetPlayerPos(playeridxyz);
    
GetPlayerFacingAngle(playeridvA);
    
AtmInfo[atmid][atmX] = x;
    
AtmInfo[atmid][atmY] = y;
    
AtmInfo[atmid][atmZ] = z;
    
AtmInfo[atmid][atmName] = name;
    
CreatingATMObject[playerid] = atmid;
    
ATMobject[atmid] = CreateObject(2942+ (1.0 floatsin(-vAdegrees)), + (1.0 floatcos(-vAdegrees)), z0.00.00.0);
    
EditObject(playeridATMobject[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