Objects Moving in diffrent rottation
#1

can anyone help me out in this small script
its a moving object script

scripts are working fine

but in game when i type cmd object is opening and closing in diffrnt rotation

this is the scripts

PHP Code:
#include <a_samp>
#include <streamer>
#define COLOR_GREEN 0xFF8000FF
new gate0;
new 
gate1;
public 
OnFilterScriptInit()
{
    print(
"\n--------------------------------------");
    print(
" Multiple Gates ");
    print(
"--------------------------------------\n");
    
gate0 CreateDynamicObject(2988,-1892.30004883,2191.50000000,3.480000010,0.00000000,0.00000000,58.00000000); //object(comp_wood_gate) (1)
    
gate1 CreateDynamicObject(2988,-1885.40002441,2186.80004883,3.48000010,0.00000000,0.00000000,233.50000000); //object(comp_wood_gate) (2)
    
return 1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    if(!
strcmp(cmdtext"/openg"true))
    {
        
MoveDynamicObject(gate0, -1895.80004883,2193.80004883,3.480000101); //object(comp_wood_gate) (1)
        
MoveDynamicObject(gate1, -1882.09997559,2184.50000000,3.480000101);
        
SendClientMessage(playerid0xFF8000FF"The gate is opening close it right after you enterd!");
        return 
1;
    }
    if(!
strcmp(cmdtext"/closeg"true))
    {
        
MoveDynamicObject(gate0, -1892.30004883,2191.50000000,3.480000101);
        
MoveDynamicObject(gate1, -1885.40002441,2186.80004883,3.480000101);
        
SendClientMessage(playerid0xFF8000FF"The gate is closing!");
        return 
1;
    }
    return 
0;

this two are the obejects
i made script for two objects to move in one cmd like two gates opening or sliding from center to left/right

this is closed gate. gate0 and gate1

PHP Code:
CreateObject(2988,-1892.30004883,2191.50000000,3.40000010,0.00000000,0.00000000,58.00000000); //object(comp_wood_gate) (1)
    
CreateObject(2988,-1885.40002441,2186.80004883,3.40000010,0.00000000,0.00000000,233.50000000); //object(comp_wood_gate) (2) 
this is open gate gate0, gate1

PHP Code:
CreateObject(2988,-1895.80004883,2193.80004883,3.40000010,0.00000000,0.00000000,58.00000000); //object(comp_wood_gate) (1)
    
CreateObject(2988,-1882.09997559,2184.50000000,3.40000010,0.00000000,0.00000000,233.50000000); //object(comp_wood_gate) (2) 
ok this is what happens first the two objects are in the place where i wanted ie rotation 58 and 233.

now am trying to /open now the objects i.e gates open but the object rotation changes ex: if its in 58 and 233 when i use cmd it changes to 95 and 180

but it is closing and opening just that obeject is in difrnt rotation


hope i explained detail

can anyone help me out ?
Reply
#2

Rotations are included in MoveDynamicObject/MoveObject so you will have to add the rotates too.
pawn Code:
MoveDynamicObject(gate0, -1895.80004883,2193.80004883,3.48000010, 1, 0.00000000,0.00000000,58.00000000); // Replace this with the opening ones.
MoveDynamicObject(gate1, -1882.09997559,2184.50000000,3.48000010, 1, 0.00000000,0.00000000,233.50000000);

MoveDynamicObject(gate0, -1892.30004883,2191.50000000,3.480000101, 1, 0.00000000,0.00000000,58.00000000); // For closing.
MoveDynamicObject(gate1, -1885.40002441,2186.80004883,3.480000101, 1, 0.00000000,0.00000000,233.50000000);
Reply
#3

Thanks for the reply

i tried that before

what happens is i get this warnings

PHP Code:
D:\GTA San Andreas\samp server files\server files\filterscripts\bhgate.pwn(23) : warning 202number of arguments does not match definition
D
:\GTA San Andreas\samp server files\server files\filterscripts\bhgate.pwn(23) : warning 202number of arguments does not match definition
D
:\GTA San Andreas\samp server files\server files\filterscripts\bhgate.pwn(23) : warning 202number of arguments does not match definition
D
:\GTA San Andreas\samp server files\server files\filterscripts\bhgate.pwn(24) : warning 202number of arguments does not match definition
D
:\GTA San Andreas\samp server files\server files\filterscripts\bhgate.pwn(24) : warning 202number of arguments does not match definition
D
:\GTA San Andreas\samp server files\server files\filterscripts\bhgate.pwn(24) : warning 202number of arguments does not match definition
D
:\GTA San Andreas\samp server files\server files\filterscripts\bhgate.pwn(30) : warning 202number of arguments does not match definition
D
:\GTA San Andreas\samp server files\server files\filterscripts\bhgate.pwn(30) : warning 202number of arguments does not match definition
D
:\GTA San Andreas\samp server files\server files\filterscripts\bhgate.pwn(30) : warning 202number of arguments does not match definition
D
:\GTA San Andreas\samp server files\server files\filterscripts\bhgate.pwn(31) : warning 202number of arguments does not match definition
D
:\GTA San Andreas\samp server files\server files\filterscripts\bhgate.pwn(31) : warning 202number of arguments does not match definition
D
:\GTA San Andreas\samp server files\server files\filterscripts\bhgate.pwn(31) : warning 202number of arguments does not match definition
Pawn compiler 3.2.3664              Copyright 
(c1997-2006ITB CompuPhase
12 Warnings

and in game the gate doesnt move
Reply
#4

Make sure you have updated all to 0.3e, the plugin, pawno folder and it includes and such as, and don't forget to open the 0.3e pawno file first, then open any script normally.
Reply
#5

you forgot 1 paramets
pawn Code:
native MoveDynamicObject(objectid, Float:x, Float:y, Float:z, Float:speed, Float:rx = -1000.0, Float:ry = -1000.0, Float:rz = -1000.0);
Reply
#6

Thanks for the replys

but am using the latest of 0.3e

and

Skaizo

can you edit my MoveDynamicObject and give the script

or can you specify which paramets i missied?
Reply
#7

OK, here is the code which is working

pawn Code:
//FS
#include <a_samp>
#include <streamer>

#define COLOR_GREEN 0xFF8000FF

new gate0;
new gate1;

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Multiple Gates ");
    print("--------------------------------------\n");
    gate0 = CreateDynamicObject(2988,-1892.30004883,2191.50000000,3.480000010,0.00000000,0.00000000,58.00000000); //object(comp_wood_gate) (1)
    gate1 = CreateDynamicObject(2988,-1885.40002441,2186.80004883,3.48000010,0.00000000,0.00000000,233.50000000); //object(comp_wood_gate) (2)
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/openg", true))
    {
        MoveDynamicObject(gate0, -1895.80004883,2193.80004883,3.48000010, 1); //object(comp_wood_gate) (1)
        MoveDynamicObject(gate1, -1882.09997559,2184.50000000,3.48000010, 1);
        SendClientMessage(playerid, 0xFF8000FF, "The gate is opening close it right after you enterd!");
        return 1;
    }
    if(!strcmp(cmdtext, "/closeg", true))
    {
        MoveDynamicObject(gate0, -1892.30004883,2191.50000000,3.480000101, 1 );
        MoveDynamicObject(gate1, -1885.40002441,2186.80004883,3.480000101, 1 );
        SendClientMessage(playerid, 0xFF8000FF, "The gate is closing!");
        return 1;
    }
    return 0;
}
pawn Code:
//GameMode
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Blank Filterscript by your name here");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#else

main()
{
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
    // Don't use these lines if it's a filterscript
    SetGameModeText("Blank Script");
    AddPlayerClass(0, -1892.30004883+5,2191.50000000,3.480000010, 269.1425, 0, 0, 0, 0, 0, 0);
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;
}

public OnPlayerConnect(playerid)
{
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    return 1;
}

public OnPlayerSpawn(playerid)
{
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
    return 1;
}

public OnPlayerText(playerid, text[])
{
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/mycommand", cmdtext, true, 10) == 0)
    {
        // Do something here
        return 1;
    }
    return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
    return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
    return 1;
}

public OnRconCommand(cmd[])
{
    return 1;
}

public OnPlayerRequestSpawn(playerid)
{
    return 1;
}

public OnObjectMoved(objectid)
{
    return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
    return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
    return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
    return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
    return 1;
}

public OnPlayerExitedMenu(playerid)
{
    return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
    return 1;
}

public OnPlayerUpdate(playerid)
{
    return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
    return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
    return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
    return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    return 1;
}
[ame]http://www.youtube.com/watch?v=wEFRXwwZgas[/ame]
Reply
#8

Thanks for the help.....
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)