01.09.2016, 06:53
Hey guys. My friend made dynamic GPS system for me but there is one problem. It will update list of locations only when i restart server.
There is command for creating it. If you need anything else tell me
PHP код:
CMD:creategps(playerid, params[])
{
if (PlayerInfo[playerid][Admin] < 5)
{
ERROR(playerid, "You are not authorized!");
return 1;
}
if (sscanf(params, "s[40]", params[0]))
{
KORISTI(playerid, "/creategps [Name]");
return 1;
}
if (strlen(params[0]) < 3)
{
ERROR(playerid, "3 characters minimum!");
return 1;
}
new Free_GPSID = Iter_Free(i_GPSLocations);
if (Free_GPSID > MAX_GPS_LOCATIONS)
{
ERROR(playerid, "Not more than 20 locations");
return 1;
}
new Float: pX, Float: pY, Float: pZ;
GetPlayerPos(playerid, pX, pY, pZ);
format(GPSData[Free_GPSID][gpsName], 40, "%s", params[0]);
GPSData[Free_GPSID][gpsXPos] = pX;
GPSData[Free_GPSID][gpsYPos] = pY;
GPSData[Free_GPSID][gpsZPos] = pZ;
GPSData[Free_GPSID][gpsExist] = 1;
SachuvajGps(Free_GPSID);
new x_string[50];
format(x_string, sizeof(x_string), "You've create gps ID: %d", Free_GPSID);
SCM(playerid, -1, x_string);
return 1;
}