25.06.2018, 18:26
Change ur code into this..
To understand what I've done.. I returned a client message to the player if he's not in the right place instead of returning 0, because returning 0 causes that the server sends you the unknown command error.
PHP код:
if(strcmp(cmdtext, "/eat", true)==0)
{
for(new x; x<places; x++)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0,PlesI[x][EnterPos][0],PlesI[x][EnterPos][1d],PlesI[x][EnterPos][2]))
{
new msg[1200];
format(msg,sizeof(msg),"{0099FF}[>>]{FFFFFF} %s text!",PlesI[x][vietospav]);
SetPlayerMapIcon(playerid, 73, PlesI[x][EnterPos][0],PlesI[x][EnterPos][1],PlesI[x][EnterPos][2], 6, 0, MAPICON_GLOBAL);
}
else return SendClientMessage(playerid, 0xFFFFFF, "You're not in the correct place");
}
return 1;
}