10.01.2013, 17:10
So, I'm working on a /v command where you type /v [option]. One of the options is buy, which should show you a dialog. Im doing a check if the person is at commerce dealership or not. if he isn't it should return a message saying so, if he is, it should show him the dialog. In reality, if he isnt in range, it works fine, but if he is, nothing happens. Can't understand it.
Код:
CMD:vehicle(playerid,params[]) { new option[10]; new vehoption; if(sscanf(params,"s[10]",option)) return SendClientMessage(playerid,COLOR_RED,"/v(ehicle) [option]"); sscanf(params,"s[10]i",option,vehoption); if(strlen(option)<3) return 1; if(!strcmp(option,"buy",true)) { if(!IsPlayerInRangeOfPoint(playerid,20,pos_dealership_commerce)) return SendClientMessage(playerid,COLOR_RED,"You have to be at a vehicle dealership to use this."); ShowPlayerDialog(playerid,DIALOG_VEH_CATEGORY,DIALOG_STYLE_MSGBOX,"Hello","Hello","Hello",""); SendClientMessage(playerid,COLOR_GREEN,"Hello"); } return 1; }