new Gate;//This will create your object/gate name
Gate = CreateObject(2587, X, Y, Z, Xr, Yr, Zr);
2587 ---ID of the Object 2001.195679 ----X Position 1547.113892 ----Y Position 14.283400 ----Z Position 0.0, 0.0, 96.0 ---- X,Y,Z Rotations of the object |
/save
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/pgate", cmdtext, true, 10) == 0)
{
MoveObject(Gate,X, Y, Z+/-3,0.97);//This will move the gate
}
return 1;
}
if (strcmp("/pgateclose", cmdtext, true, 10) == 0)
{
MoveObject(Gate,X, Y, Z,3,0.97);//This will move the gate back to the old position
}
return 1;
}
return 1;
}
Gate ----The object name that we have fixed in the GM Begin X ----The new X position(can be the same with first one if you wish to move the gate in another position!) Y ----The new Y position(can be the same with first one if you wish to move the gate in another position!) Z ----The new Z Position(can be the same with first one if you wish to move the gate in another position!) 0.97 ----The speed of which the object will be moved with. |
public OnPlayerCommandText(...)
{
if (strcmp("/pgate", cmdtext, true, 10) == 0)
{
MoveObject(Gate,X, Y, Z+/-3,0.97);//This will move the gate
SendClientMessage(playerid,COLOR_BLUE,"You have opened the gate,it will be closed in 7 seconds!");//This will send an message announcing the gate Stats!
SetTimer("GateClose", 7000, 0);//This will start the counting till the gate will be closed!
}
return 1;
}
return 1;
}
forward GateClose(playerid)//This will forward the closing gate function
public GateClose(playerid)//This will define the closing gate function
{
MoveObject(Gate,X, Y, Z-/+3,0.97);//This will move the gate
PlayerPlaySound(playerid, 1153, x,y,z);// This will play the gate sound near the gate
return 1;
}
This forum requires that you wait 120 seconds between posts. Please try again in 74 seconds. |
C:\Users\Sweet Mafia.Admin-HP\Desktop\gate_one.pwn(9) : error 010: invalid function or declaration C:\Users\Sweet Mafia.Admin-HP\Desktop\gate_one.pwn(15) : error 076: syntax error in the expression, or invalid function call C:\Users\Sweet Mafia.Admin-HP\Desktop\gate_one.pwn(15) : warning 215: expression has no effect C:\Users\Sweet Mafia.Admin-HP\Desktop\gate_one.pwn(15) : warning 215: expression has no effect C:\Users\Sweet Mafia.Admin-HP\Desktop\gate_one.pwn(15) : warning 215: expression has no effect C:\Users\Sweet Mafia.Admin-HP\Desktop\gate_one.pwn(15) : warning 215: expression has no effect C:\Users\Sweet Mafia.Admin-HP\Desktop\gate_one.pwn(15) : warning 215: expression has no effect C:\Users\Sweet Mafia.Admin-HP\Desktop\gate_one.pwn(17) : warning 217: loose indentation C:\Users\Sweet Mafia.Admin-HP\Desktop\gate_one.pwn(19) : error 010: invalid function or declaration C:\Users\Sweet Mafia.Admin-HP\Desktop\gate_one.pwn(23) : error 010: invalid function or declaration C:\Users\Sweet Mafia.Admin-HP\Desktop\gate_one.pwn(26) : error 010: invalid function or declaration C:\Users\Sweet Mafia.Admin-HP\Desktop\gate_one.pwn(28) : warning 203: symbol is never used: "Gate" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 5 Errors.
Код:
C:\Users\Sweet Mafia.Admin-HP\Desktop\gate_one.pwn(9) : error 010: invalid function or declaration C:\Users\Sweet Mafia.Admin-HP\Desktop\gate_one.pwn(15) : error 076: syntax error in the expression, or invalid function call C:\Users\Sweet Mafia.Admin-HP\Desktop\gate_one.pwn(15) : warning 215: expression has no effect C:\Users\Sweet Mafia.Admin-HP\Desktop\gate_one.pwn(15) : warning 215: expression has no effect C:\Users\Sweet Mafia.Admin-HP\Desktop\gate_one.pwn(15) : warning 215: expression has no effect C:\Users\Sweet Mafia.Admin-HP\Desktop\gate_one.pwn(15) : warning 215: expression has no effect C:\Users\Sweet Mafia.Admin-HP\Desktop\gate_one.pwn(15) : warning 215: expression has no effect C:\Users\Sweet Mafia.Admin-HP\Desktop\gate_one.pwn(17) : warning 217: loose indentation C:\Users\Sweet Mafia.Admin-HP\Desktop\gate_one.pwn(19) : error 010: invalid function or declaration C:\Users\Sweet Mafia.Admin-HP\Desktop\gate_one.pwn(23) : error 010: invalid function or declaration C:\Users\Sweet Mafia.Admin-HP\Desktop\gate_one.pwn(26) : error 010: invalid function or declaration C:\Users\Sweet Mafia.Admin-HP\Desktop\gate_one.pwn(28) : warning 203: symbol is never used: "Gate" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 5 Errors. help? |
C:\Users\Sweet Mafia.Admin-HP\Desktop\gate_one.pwn(28) : warning 203: symbol is never used: "Gate"
//Los Santos Military Transportation Electric Gates
#include <a_samp>
new aGate;
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);
aGate = CreateObject(976,2720.53076172,-2409.44506836,12.46093750,0.00000000,0.00000000,90 .00000000);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/gate", cmdtext, true, 10) == 0)
{
MoveObject (976,2720.53076172,-2401.33911133,12.46093750,0.00000000,0.00000000,90 .00000000);//This will move the gate
}
return 1;
}
if (strcmp("/closegate", cmdtext, true, 10) == 0)
{
MoveObject (976,2720.53076172,-2409.44506836,12.46093750,0.00000000,0.00000000,90 .00000000);//This will move the gate back to the old position
}
return 1;
}
return 1;
}
Can you please tell me what is wrong with this and correct it.
pawn Code:
|
//Los Santos Military Transportation Electric Gates
#include <a_samp>
new Gate;
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);
aGate = CreateObject(976,2720.53076172,-2409.44506836,12.46093750,0.00000000,0.00000000,90 .00000000);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/gate", cmdtext, true, 10) == 0)
{
MoveObject (Gate,2720.53076172,-2401.33911133,12.46093750,0.00000000,0.00000000,90 .00000000);
}
return 1;
}
if (strcmp("/closegate", cmdtext, true, 10) == 0)
{
MoveObject (Gate,2720.53076172,-2409.44506836,12.46093750,0.00000000,0.00000000,90 .00000000);
}
return 1;
}
return 1;
}
//Los Santos Military Transportation Electric Gates
#include <a_samp>
new Gate;
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);
Gate = CreateObject(976,2720.53076172,-2409.44506836,12.46093750,0.00000000,0.00000000,90 .00000000);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/gate", cmdtext, true, 10) == 0)
{
MoveObject (Gate,2720.53076172,-2401.33911133,12.46093750,0.90);
}
return 1;
}
if (strcmp("/closegate", cmdtext, true, 10) == 0)
{
MoveObject (Gate,2720.53076172,-2409.44506836,12.46093750,0.90);
}
return 1;
}
return 1;
}
C:\Users\Sweet Mafia.Admin-HP\Desktop\Untitled.pwn(12) : error 001: expected token: ",", but found "." C:\Users\Sweet Mafia.Admin-HP\Desktop\Untitled.pwn(12) : error 029: invalid expression, assumed zero C:\Users\Sweet Mafia.Admin-HP\Desktop\Untitled.pwn(12) : warning 215: expression has no effect C:\Users\Sweet Mafia.Admin-HP\Desktop\Untitled.pwn(12) : error 001: expected token: ";", but found ")" C:\Users\Sweet Mafia.Admin-HP\Desktop\Untitled.pwn(12) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
//Los Santos Military Transportation Electric Gates
#define FILTERSCRIPT
#include <a_samp>
new Gate;
public OnFilterScriptInit()
{
// 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);
Gate = CreateObject(976, 2720.53076172, -2409.44506836, 12.46093750, 0.0, 0.0, 90.0);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp("/gate", cmdtext, true, 5))
{
MoveObject (Gate,2720.53076172,-2401.33911133,12.46093750,0.90);
return 1;
}
{
if (!strcmp("/closegate", cmdtext, true, 10))
{
MoveObject (Gate,2720.53076172,-2409.44506836,12.46093750,0.90);
return 1;
}
return 0;
}
}
// All Credits to whisperftw, need help ? PM on SA-MP Forums
// If you delete these two lines you are NOT a MAN !
Can you please tell me what is wrong with this and correct it.
pawn Code:
|
#include <a_samp>
new aGate;
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);
aGate = CreateObject(976,2720.53076172,-2409.44506836,12.46093750,0.00000000,0.00000000,90.00000000);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp ("/gate", cmdtext, true) == 0)
{
MoveObject(aGate, 2720.53076172, -2401.33911133, 12.46093750,2);//This will move the gate
return 1;
}
if(strcmp ("/closegate", cmdtext, true) == 0)
{
MoveObject(aGate, 2720.53076172, -2409.44506836, 12.46093750, 2);//This will move the gate back to the old position
return 1;
}
return 0;
}