06.10.2018, 09:39
i really don't understand what you want, but here is an improved verison of your script:
i removed that gateid think. your command dosen't require sscanf. i also created the variabiles string[128], szMessage[32], Float:fGatePos[3] before the loop, it didn't make any sense defining them repeatedly
PHP код:
CMD:ffind(playerid, params[]){
if(PlayerInfo[playerid][pDuty] == 0 || !IsACop(playerid)) return SendClientMessageEx(playerid, COLOR_GRAD2, "Ban khong phai la nhan vien nha nuoc.");
{
SendClientMessageEx(playerid, COLOR_RED, "* Listing all gates within 5 meters of you...");
new string[128], szMessage[32], Float:fGatePos[3];
for(new i; i < MAX_GATES; i++){
GetDynamicObjectPos(GateInfo[i][gGATE], fGatePos[0], fGatePos[1], fGatePos[2]);
if(IsPlayerInRangeOfPoint(playerid, 5, fGatePos[0], fGatePos[1], fGatePos[2]))
{
if(GateInfo[i][gModel] != 0)
{
format(szMessage, sizeof(szMessage), "Gate ID %d (VW: %d)", i, GateInfo[i][gVW]);
SendClientMessageEx(playerid, COLOR_WHITE, szMessage);
format(string,sizeof(string),"|___________ Password Gate (ID: %d) ___________|", i);
SendClientMessageEx(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "PassWord Gate: %s", GateInfo[i][gPass]);
SendClientMessageEx(playerid, COLOR_WHITE, string);
}
}
}
}
return 1;
}