22.06.2017, 10:29
I;ve implemented this code:
But when i run the game ,i type one of the command it says Server: Unknown Command ?,i got no error while compiling....
Where is the problem?
PHP код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(IsPlayerAdmin(playerid))
{
if(!strcmp("/gotomb", cmdtext, true))
{
SetPlayerPos(playerid, MoneyBagPos[0], MoneyBagPos[1] +3, MoneyBagPos[2]);
return SendClientMessage(playerid, -1, "You have been {FF0000}teleported {FFFFFF}to the {33FF66}money bag");
}
if(!strcmp("/startmb", cmdtext, true)) return MoneyBag();
if(!strcmp("/togglemb", cmdtext, true))
{
if(Timer[0] == 0)
{
KillTimer(Timer[1]);
Timer[0] = 1;
SendClientMessage(playerid, -1, "Money bag turned {FF0000} off!");
return 1;
}
if(Timer[0] == 1)
{
Timer[1] = SetTimer("MoneyBag", MB_DELAY, true);
Timer[0] = 0;
SendClientMessage(playerid, -1, "Money bag turned {33FF66} on!");
return 1;
}
return 1;
}
}
if(!strcmp("/moneybag", cmdtext, true))
{
new string[150];
if(!MoneyBagFound) format(string, sizeof(string), "**The {33FF66}Money Bag has been {FF0000}hidden in {FFFF66}%s!", MoneyBagLocation);
if(MoneyBagFound) format(string, sizeof(string), "**The {33FF66}Money Bag is {FF0000} not running!");
return SendClientMessage(playerid, -1, string);
}
if(!strcmp("/mb", cmdtext, true))
{
new string[150];
if(!MoneyBagFound) format(string, sizeof(string), "**The {33FF66}Money Bag has been {FF0000}hidden in {FFFF66}%s!", MoneyBagLocation);
if(MoneyBagFound) format(string, sizeof(string), "**The {33FF66}Money Bag is {FF0000} not running!");
return SendClientMessage(playerid, -1, string);
}
if(!strcmp("/teleport", cmdtext, true))
{
SetPlayerPos(playerid, -1967.8365, 2956.9823, 12.9375);
return 1;
}
return 0;
}
Where is the problem?