#include <a_samp>
#define FILTERSCRIPT
new gate1;
public OnFilterScriptInit()
{
gate1 = CreateObject(969, 2231.45703, -2212.44116, 12.53181, 0.00000, 0.00000, -45.00000); //Gate1
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/open", true))
{
if(IsPlayerInRangeOfPoint(playerid, 15.0, 2231.4570, -2212.4412, 9.3241))
{
MoveObject(gate1, 2231.4570, -2212.4412, 9.3241, 5);
SendClientMessage(playerid, 0x0000BBAA, "the Gate Opened Successfuly , Weclome !");
return 1;
}
}
if(!strcmp(cmdtext, "/close", true))
{
if(IsPlayerInRangeOfPoint(playerid, 15.0, 2231.45703, -2212.44116, 12.53181))
{
MoveObject(gate1, 2231.45703, -2212.44116, 12.53181, 5);
SendClientMessage(playerid, 0xAA3333AA, "the Gate Closed successfuly !");
return 1;
}
}
return 0;
}
gate1 = CreateObject(969, 2231.45703, -2212.44116, 12.53181, 0.00000, 0.00000, -45.00000); //Gate1
#include <a_samp>
#define FILTERSCRIPT
new gate1;
public OnFilterScriptInit()
{
gate1 = CreateObject(969, 2231.45703, -2212.44116, 12.53181, 0.00000, 0.00000, -45.00000); //Gate1
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/open", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 15.0, 2231.4570, -2212.4412, 9.3241))
{
MoveObject(gate1, 2231.4570, -2212.4412, 9.4048, 5);
SendClientMessage(playerid, 0x0000BBAA, "the Gate Opened Successfuly , Weclome !");
return 1;
}
}
if (strcmp("/close", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 15.0, 2231.45703, -2212.44116, 12.53181))
{
MoveObject(gate1, 2231.45703, -2212.44116, 12.53181, 5);
SendClientMessage(playerid, 0xAA3333AA, "the Gate Closed successfuly !");
return 1;
}
}
return 0;
}
It does not work in game when i type in /open or /close it just said bad command
|
//Includes #include <zcmd> //Commands processor - Quicker and better IMO //New-Gates new gate1; 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 Creation gate1 = CreateObject(969, 2231.45703, -2212.44116, 12.53181, 0.00000, 0.00000, -45.00000); return 1; }
//Below you can change the command, All you need to do is change next to the CMD: part to whatever you want your command to be. Make sure there is not a space between the colon and the command its self. CMD:closegate(playerid, params[]) { MoveObject(gate1, 2231.45703, -2212.44116, 12.53181, 1); SendClientMessage(playerid, 0xEF994300, "You opened (Gate Name Here)..."); return 1; } CMD:opengate(playerid, params[]) { MoveObject(gate1, 2231.4570, -2212.4412, 9.3241, 1); SendClientMessage(playerid, 0xEF994300, "You closed (Gate Name Here)..."); return 1; }