MoveObject problem..
#1

Hey all,

I'm kind of new to scripting, and I wanted to make some moving gates, but somehow I get errors..
Can you guys please help me? (:


This is the code

Quote:

new base1;
new base2;

#include <a_samp>
#define filterscript
#define cmdtext
public OnFilterScriptInit()
{
base1 = CreateObject(976,-1826.97546387,-179.85420227,8.49923420,0.00000000,0.00000000,91.3 4985352); //object(phils_compnd_gate) (1)
CreateObject(976,-1827.14135742,-172.87338257,8.49923420,0.00000000,0.00000000,91.3 4582520); //object(phils_compnd_gate) (2)
CreateObject(923,-1817.16235352,-185.89990234,9.27812386,0.00000000,0.00000000,0.00 000000); //object(packing_carates2) (1)
CreateObject(2358,-1810.23693848,-153.06494141,8.51497269,0.00000000,0.00000000,180. 64062500); //object(ammo_box_c2) (1)
CreateObject(944,-1824.66503906,-148.64460754,9.28322411,0.00000000,0.00000000,0.00 000000); //object(packing_carates04) (1)
CreateObject(1431,-1826.07312012,-159.84355164,8.94605064,0.00000000,0.00000000,269. 11322021); //object(dyn_box_pile) (1)
CreateObject(3800,-1816.23352051,-155.15504456,8.40561485,0.00000000,0.00000000,0.00 000000); //object(acbox4_sfs) (1)
CreateObject(923,-1825.92700195,-153.66746521,9.27812386,0.00000000,0.00000000,271. 12042236); //object(packing_carates2) (2)
base2 = CreateObject(969,-1809.30407715,-133.15089417,5.26618481,0.00000000,0.00000000,267. 59045410); //object(electricgate) (1)
CreateObject(969,-1809.47680664,-137.95425415,5.26618481,0.00000000,0.00000000,267. 5885009; //object(electricgate) (2)
CreateObject(1271,-1826.03601074,-169.84703064,8.74843788,0.00000000,0.00000000,0.00 000000); //object(gunbox) (1)

if (strcmp("/base11", cmdtext, true, 10) == 0)
{
MoveObject(base1,-1827.14135742,-172.87338257,8.49923420, 2.00);
SetTimer("close", 7000, 0);//gate will be closed for 7 seconds
SendClientMessage(playerid,GREEN,"You are opening Base1, and will be closed automatically.");
return 1;}
}
if (strcmp("/base2", cmdtext, true, 10) == 0)
{
MoveObject(bmerc2,-1809.47680664,-137.95425415,5.26618481, 2.00);
SetTimer("close", 7000, 0);//gate will be closed for 7 seconds
SendClientMessage(playerid,GREEN,"You are opening Base2, and will be closed automatically.");
return 1;}
}
#endif

This are the errors:

Quote:

I:\Script\Server\Filterscripts\Mercenary base\MercBase 1 gate each.pwn(14) : error 017: undefined symbol "base11"
I:\Script\Server\Filterscripts\Mercenary base\MercBase 1 gate each.pwn(26) : warning 217: loose indentation
I:\Script\Server\Filterscripts\Mercenary base\MercBase 1 gate each.pwn(26) : error 029: invalid expression, assumed zero
I:\Script\Server\Filterscripts\Mercenary base\MercBase 1 gate each.pwn(26) : warning 215: expression has no effect
I:\Script\Server\Filterscripts\Mercenary base\MercBase 1 gate each.pwn(26) : warning 215: expression has no effect
I:\Script\Server\Filterscripts\Mercenary base\MercBase 1 gate each.pwn(26) : error 001: expected token: ";", but found ")"
I:\Script\Server\Filterscripts\Mercenary base\MercBase 1 gate each.pwn(26) : error 029: invalid expression, assumed zero
I:\Script\Server\Filterscripts\Mercenary base\MercBase 1 gate each.pwn(26) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


5 Errors.

Reply
#2

try changin the object on command 2

if (strcmp("/base2", cmdtext, true, 5) == 0)
{
MoveObject(base2,-1809.47680664,-137.95425415,5.26618481, 2.00);
SetTimer("close", 7000, 0);//gate will be closed for 7 seconds
SendClientMessage(playerid,GREEN,"You are opening Base2, and will be closed automatically.");
return 1;}
Reply
#3

ok i dun it i think try it




// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>

#define FILTERSCRIPT
#define GREEN 0x00FF00FF
new base1;
new base2;

public OnFilterScriptInit()
{

print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
base1 =CreateObject(976,-1826.97546387,-179.85420227,8.49923420,0.00000000,0.000000000,91. 3);
CreateObject(976,-1827.14135742,-172.87338257,8.49923420,0.00000000,0.00000000,91.3 ); //object(phils_compnd_gate) (2)
CreateObject(923,-1817.16235352,-185.89990234,9.27812386,0.00000000,0.00000000,0); //object(packing_carates2) (1)
CreateObject(2358,-1810.23693848,-153.06494141,8.51497269,0.00000000,0.00000000,180. 6); //object(ammo_box_c2) (1)
CreateObject(944,-1824.66503906,-148.64460754,9.28322411,0.00000000,0.00000000,0); //object(packing_carates04) (1)
CreateObject(1431,-1826.07312012,-159.84355164,8.94605064,0.00000000,0.00000000,269. 1); //object(dyn_box_pile) (1)
CreateObject(3800,-1816.23352051,-155.15504456,8.40561485,0.00000000,0.00000000,0); //object(acbox4_sfs) (1)
CreateObject(923,-1825.92700195,-153.66746521,9.27812386,0.00000000,0.00000000,271. 1); //object(packing_carates2) (2)
base2 = CreateObject(969,-1809.30407715,-133.15089417,5.26618481,0.00000000,0.00000000,267. 5); //object(electricgate) (1)
CreateObject(969,-1809.47680664,-137.95425415,5.26618481,0.00000000,0.00000000,267. 5); //object(electricgate) (2)
CreateObject(1271,-1826.03601074,-169.84703064,8.74843788,0.00000000,0.00000000,0); //object(gunbox) (1)

return 1;
}

public OnFilterScriptExit()
{
return 1;
}



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



public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 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("/base11", cmdtext, true, 10) == 0)
{
MoveObject(base1,-1827.14135742,-172.87338257,8.49923420, 2.00);
SetTimer("close", 7000, 0);//gate will be closed for 7 seconds
SendClientMessage(playerid,GREEN,"You are opening Base1, and will be closed automatically.");
return 1;
}
if (strcmp("/base2", cmdtext, true, 10) == 0)
{
MoveObject(base2,-1809.47680664,-137.95425415,5.26618481, 2.00);
SetTimer("close", 7000, 0);//gate will be closed for 7 seconds
SendClientMessage(playerid,GREEN,"You are opening Base2, and will be closed automatically.");
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;
}
Reply
#4

Yeah I already fixed it, thanks for the help.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)