Problem 4
#1

Hi, I have this script:

In the first line by colour code:

Код:
new door;

forward outdoor();
In OnGameModeInit:

Код:
door=CreateObject(1569, 245.791015625, 72.68359375, 1002.640625);
In OnPlayerCommandText:

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  new string[256];
	new playermoney;
	new sendername[MAX_PLAYER_NAME];
	new giveplayer[MAX_PLAYER_NAME];
	new playername[MAX_PLAYER_NAME];
	new cmd[256];
	new tmp[256];
	new giveplayerid, moneys, idx;
	cmd = strtok(cmdtext, idx);
	
if( !strcmp(cmdtext, "/door", true) )
  {
  MoveObject(door, 0.0000, 0.0000, 111.15942382813);
  SetTimer("outdoor",5000, false);
  return 0;
  }
In Game:

Код:
Say: /door (in LSPD HQ)
Server unknow command.
What should I do to go xD?
Reply
#2

Change

pawn Код:
if( !strcmp(cmdtext, "/door", true) )
{
  MoveObject(door, 0.0000, 0.0000, 111.15942382813);
  SetTimer("outdoor",5000, false);
  return 0;
}
To

pawn Код:
if(!strcmp(cmdtext, "/door", true))
{
  MoveObject(door, 0.0000, 0.0000, 111.15942382813);
  SetTimer("outdoor",5000, false);
  return 1;
}
Returning 0 at the end of the command will make it say "Server unknown Command". The command should still execute regardless .
Reply
#3

is the forward door needed?
i think you only need
new door; instead of forward door();
Reply
#4

Do not go...
Reply
#5

pawn Код:
#define FILTERSCRIPT
#include <a_samp>
#define COLOR_BRIGHTRED 0xFF0000AA
#define COLOR_YELLOW 0xFFFF00AA
#pragma tabsize 0
  new openmygate;
forward GateCheck();
new mygate;
public OnFilterScriptInit()
{
  mygate=CreateObject(980,1240.456,-740.180,97.381,0.0,5.157,26.797);
  SetTimer("GateCheck",30000,1);
}
public GateCheck()
{
  if(openmygate == 1) MoveObject(mygate,1240.456,-740.180,97.381, 1);
  openmygate = 0;
}


public OnPlayerCommandText(playerid, cmdtext[])
    {
      if (strcmp("/dooropen", cmdtext, true, 10) == 0)
      {
        if(IsPlayerConnected(playerid))
        {
      if(!IsPlayerInRangeOfPoint(playerid, 50.0, 1240.341,-740.190,91.871)) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You have to be near that gate to use this command.");
    else
        MoveObject(mygate,1240.341,-740.190,91.871, 1);
        openmygate = 1;
        SendClientMessage(playerid, COLOR_YELLOW, "Door opened. It will automatically close after 30 seconds.");
             }
            return 1;
      }
    return 0;
}
try to do like this ,iam using this in my script
Reply
#6

I want my door original, not copied, you understand?
Reply
#7

Quote:
Originally Posted by [HiC
TheKiller ]
Change

pawn Код:
if( !strcmp(cmdtext, "/door", true) )
{
 MoveObject(door, 0.0000, 0.0000, 111.15942382813);
 SetTimer("outdoor",5000, false);
 return 0;
}
To

pawn Код:
if(!strcmp(cmdtext, "/door", true))
{
 MoveObject(door, 0.0000, 0.0000, 111.15942382813);
 SetTimer("outdoor",5000, false);
 return 1;
}
Returning 0 at the end of the command will make it say "Server unknown Command". The command should still execute regardless .
as he said .
Reply
#8

Rezolved.
Closed.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)