small help
#1

i got 2 error's and i cant find where is the wrong !!

Код:
580   if(strcmp(cmdtext, "/ccell", true) == 0)
581   MoveObject(gate4, 775.6142578125, -2416.0493164063, 12.350757598877, 2.0);
582   SendClientMessage(playerid, COLOR_GREEN, " Cell Has Been Closed");
583     return 0;
584    }
and here the error's

Код:
D:\SAMPSE~1\MYSERV~1\GAMEMO~1\LancerG.pwn(580) : error 010: invalid function or declaration
D:\SAMPSE~1\MYSERV~1\GAMEMO~1\LancerG.pwn(583) : error 010: invalid function or declaration
Reply
#2

pawn Код:
if(strcmp(cmdtext, "/ccell", true) == 0)
{
    MoveObject(gate4, 775.6142578125, -2416.0493164063, 12.350757598877, 2.0);
    SendClientMessage(playerid, COLOR_GREEN, " Cell Has Been Closed");
    return 0;
}
You missed an open bracket. You may want to change return 0; to return 1; or you will get the "Server Unknown Command" message when you type the command.
Reply
#3

i tried your's i got same error's bro !
Reply
#4

well i tested the command and the problem is you dont have the command under onplayercommandtext its just crammed in theyre cuz i moved one of my commands outside and ghot those errors
Reply
#5

580 and 583

580 if(strcmp(cmdtext, "/ccell", true) == 0)
583 return 0;
Reply
#6

makesure it under public OnPlayerCommandText(playerid, cmdtext[])
and lancer im from jordan too :P but live in US
Reply
#7

Oh, I see what you have done. You have included the end of OnPlayerCommandText in your command.

Swap those lines for these
pawn Код:
if(strcmp(cmdtext, "/ccell", true) == 0)
    {
        MoveObject(gate4, 775.6142578125, -2416.0493164063, 12.350757598877, 2.0);
        SendClientMessage(playerid, COLOR_GREEN, " Cell Has Been Closed");
        return 1;
    }
    return 0;
}
Reply
#8

ok look here the whole stuff
Код:
public OnPlayerCommandText(playerid, cmdtext[]) // OnPlayerCommandText
{
  if(!strcmp(cmdtext, "/me", true, 3)) // The command itself.
  {
    if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "Correct ussage: /me [action]"); // If the player just types /me and no action.
    new str[128]; // String
    GetPlayerName(playerid, str, sizeof(str)); // Gets the player name for /me
    format(str, sizeof(str), "* %s %s", str, cmdtext[4]); // What it's going to look like.
    SendClientMessageToAll(0xFF9900AA, str); // Color to send the message to everyone in.
    return 1;
  }
  if(strcmp(cmdtext, "/ogate2", true) == 0)
	{
  MoveObject(gate1, 745.61755371094, -2395.0322265625, 15.107341766357, 2.0);
  SendClientMessage(playerid, COLOR_GREEN, "Gate 2 has been opened");
  return 1;
    }
  if(strcmp(cmdtext, "/ogate3", true) == 0)
  {
  MoveObject(gate2, 770.44696044922, -2411.9133300781, 15.461982727051, 2.0);
  SendClientMessage(playerid, COLOR_GREEN, "Gate 3 has been opened");
  return 1;
  }
  if(strcmp(cmdtext, "/ogate1", true) == 0)
  {
  MoveObject(gate3, 1003.3813476563, -2305.5224609375, 14.867141723633, 2.0);
  SendClientMessage(playerid, COLOR_GREEN, "Gate 1 has been opened 'welcome To The Jail'");
  return 1;
  }
  if(strcmp(cmdtext, "/cgate2", true) == 0)
  {
  MoveObject(gate1, 756.26232910156, -2392.1733398438, 15.107341766357, 2.0);
  SendClientMessage(playerid, COLOR_GREEN, "Gate 2 has been closed");
  return 1;
  }
  if(strcmp(cmdtext, "/cgate3", true) == 0)
  {
  MoveObject(gate2, 760.15753173828, -2415.0886230469, 15.130363464355, 2.0);
  SendClientMessage(playerid, COLOR_GREEN, "Gate 3 has been closed");
  return 1;
  }
  if(strcmp(cmdtext, "/cgate1", true) == 0)
  {
  MoveObject(gate3, 1006.1548461914, -2317.0842285156, 14.981994628906, 2.0);
  SendClientMessage(playerid, COLOR_GREEN, "Gate 1 has been closed");
  return 1;
  }
	return 0;
  }
every thing work find here without any error

but when i ad this
Код:
if(strcmp(cmdtext, "/ocell", true) == 0)
  MoveObject(cell1, 777.69183349609, -2423.8305664063, 12.350757598877, 2.0);
  SendClientMessage(playerid, COLOR_GREEN, " Cell Has Been Opened");
  return 1;
  }
  if(strcmp(cmdtext, "/ccell", true) == 0)
  MoveObject(cell1, 775.6142578125, -2416.0493164063, 12.350757598877, 2.0);
  SendClientMessage(playerid, COLOR_GREEN, " Cell Has Been Closed");
	return 1;
}
the problem's start from here !!
Reply
#9

I WAS CLOSE :P
Reply
#10

public OnPlayerCommandText(playerid, cmdtext[]) // OnPlayerCommandText
{
if(!strcmp(cmdtext, "/me", true, 3)) // The command itself.
{
if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "Correct ussage: /me [action]"); // If the player just types /me and no action.
new str[128]; // String
GetPlayerName(playerid, str, sizeof(str)); // Gets the player name for /me
format(str, sizeof(str), "* %s %s", str, cmdtext[4]); // What it's going to look like.
SendClientMessageToAll(0xFF9900AA, str); // Color to send the message to everyone in.
return 1;
}
if(strcmp(cmdtext, "/ogate2", true) == 0)
{
MoveObject(gate1, 745.61755371094, -2395.0322265625, 15.107341766357, 2.0);
SendClientMessage(playerid, COLOR_GREEN, "Gate 2 has been opened");
return 1;
}
if(strcmp(cmdtext, "/ogate3", true) == 0)
{
MoveObject(gate2, 770.44696044922, -2411.9133300781, 15.461982727051, 2.0);
SendClientMessage(playerid, COLOR_GREEN, "Gate 3 has been opened");
return 1;
}
if(strcmp(cmdtext, "/ogate1", true) == 0)
{
MoveObject(gate3, 1003.3813476563, -2305.5224609375, 14.867141723633, 2.0);
SendClientMessage(playerid, COLOR_GREEN, "Gate 1 has been opened 'welcome To The Jail'");
return 1;
}
if(strcmp(cmdtext, "/cgate2", true) == 0)
{
MoveObject(gate1, 756.26232910156, -2392.1733398438, 15.107341766357, 2.0);
SendClientMessage(playerid, COLOR_GREEN, "Gate 2 has been closed");
return 1;
}
if(strcmp(cmdtext, "/cgate3", true) == 0)
{
MoveObject(gate2, 760.15753173828, -2415.0886230469, 15.130363464355, 2.0);
SendClientMessage(playerid, COLOR_GREEN, "Gate 3 has been closed");
return 1;
}
if(strcmp(cmdtext, "/cgate1", true) == 0)
{
MoveObject(gate3, 1006.1548461914, -2317.0842285156, 14.981994628906, 2.0);
SendClientMessage(playerid, COLOR_GREEN, "Gate 1 has been closed");
return 1;
}
if(strcmp(cmdtext, "/ocell", true) == 0)
{
MoveObject(cell1, 777.69183349609, -2423.8305664063, 12.350757598877, 2.0);
SendClientMessage(playerid, COLOR_GREEN, " Cell Has Been Opened");
return 1;
}
if(strcmp(cmdtext, "/ccell", true) == 0)
{
MoveObject(cell1, 775.6142578125, -2416.0493164063, 12.350757598877, 2.0);
SendClientMessage(playerid, COLOR_GREEN, " Cell Has Been Closed");
return 1;
}
return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)