CMD:stealbomb(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, 275.3401, 1860.3333, 8.7578))
{
if(GetPlayerTeam(playerid) == Terrorists)
SendClientMessageToAll(COLOR_DARKORANGE, "%s has stolen the bomb!");
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not near the stealing point!");
}
}
CMD:stealbomb(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, 275.3401, 1860.3333, 8.7578))
{
if(GetPlayerTeam(playerid) == Terrorists)
SendClientMessageToAll(COLOR_DARKORANGE, "%s has stolen the bomb!");
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not near the stealing point!");
}
return 1;
}
CMD:stealbomb(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, 275.3401, 1860.3333, 8.7578
{
if(GetPlayerTeam(playerid) == Terrorists)
SendClientMessageToAll(COLOR_DARKORANGE, "%s has stolen the bomb!", GetPlayerName(playerid));
}
else SendClientMessage(playerid, "You are not near the stealing point!");
return 1;
}
|
Try This:
Код:
CMD:stealbomb(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, 275.3401, 1860.3333, 8.7578
{
if(GetPlayerTeam(playerid) == Terrorists)
SendClientMessageToAll(COLOR_DARKORANGE, "%s has stolen the bomb!", GetPlayerName(playerid));
}
else SendClientMessage(playerid, "You are not near the stealing point!");
return 1;
}
|
|
The unknown command comes when a number other than 1 is returned.Add return 1 at the end of the command block and its fixed.
Actually the comamnd works fine but you never told the server that it was fine.return 1 is used to tell that the command worked smoothly without any problems.return 0 will give Unkown Command. So your code must look something like this Код:
CMD:stealbomb(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, 275.3401, 1860.3333, 8.7578))
{
if(GetPlayerTeam(playerid) == Terrorists)
SendClientMessageToAll(COLOR_DARKORANGE, "%s has stolen the bomb!");
}
else
{
SendClientMessage(playerid, COLOR_RED, "You are not near the stealing point!");
}
return 1;
}
|
|
Woooops. Look at my command, I forgot to put the brackets on the "IsPlayerInRangeOfPoint". My bad, I'm a sloppy typer. :/
|
xD and was confused!!!
|
LOL Your error was there, I tought it did not work because you had removed the braces
xD and was confused!!! |
|
Nah, no need to put braces on the "else", you can just "else SendClientMessage(etc)" and "else if (code blabla)"
|