SA-MP Forums Archive
[HELP] Rotating door! - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Rotating door! (/showthread.php?tid=191334)



[HELP] Rotating door! - Larsey123IsMe - 18.11.2010

ok, i want this door to turn 90 degrees when i type /Odoor.... (Odoor = Opendoor)
But it has an ERROR too.

pawn Код:
#include <a_samp>

#define FILTERSCRIPT

forward Resetbase();

new Door;

public OnFilterScriptInit()
{
    print("\n-----------------------------------------");
    print(" Door By Larsey123");
    print("-------------------------------------------\n");
   
    Door = CreateObject(2930,370.71026611,-2045.55212402,7.98374319,0.00000000,0.00000000,270.00000000); //object(chinatgate) (1)

    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    //Turn the door 90 degrees
    if (strcmp("/Odoor", cmdtext, true) == 0)
    {
        if(IsPlayerAdmin(playerid)==1)
        {
            SetObjectRot( Door, 0, 0, 90, 2.00 );
            return 1;
        }
    }
    return 0;
}

public Resetbase()
{
    SetObjectRot( Door, 0, 0, 0 );
    }
ERROR:
pawn Код:
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\RotateObject.pwn(27) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.
The my question is: How to fix that O.o?


Re: [HELP] Rotating door! - ExEx - 18.11.2010

change
SetObjectRot( Door, 0, 0, 90, 2.00 );

to
SetObjectRot( Door, 0, 0, 90);


because
function is SetObjectRot( objectid, RotX, RotY, RotZ );

here is fixed

Quote:

public OnPlayerCommandText(playerid, cmdtext[])
{
//Turn the door 90 degrees
if (strcmp("/Odoor", cmdtext, true) == 0)
{
if(IsPlayerAdmin(playerid)==1)
{
SetObjectRot( Door, 0, 0, 90);
return 1;
}
}
return 0;
}




Re: [HELP] Rotating door! - Larsey123IsMe - 18.11.2010

Quote:
Originally Posted by ExEx
Посмотреть сообщение
change

SetObjectRot( Door, 0, 0, 90, 2.00 );

to

SetObjectRot( Door, 0, 0, 90);


because
function is SetObjectRot( objectid, RotX, RotY, RotZ );
Oh Thx man, I failed badly there xD