06.11.2015, 14:39
So I made this command /loc to locate where a player is.
when i do the /loc and id it says
so instad of sending me 1 message it sends 2 messages I only want the first one to apprear not the second one
here is to code.
if anyone can help me it would be great thanks.
when i do the /loc and id it says
Код:
Boonzay's current location is:idlewood Boonzay's current location is:los santos
here is to code.
PHP код:
CMD:loc(playerid, params[])
{
new pID;
if(sscanf(params, "u", pID)) return SendClientMessage(playerid, COLOR_LIGHTGREEN, "/loc [playerid]");
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
for(new i = 0; i != sizeof(gSAZones); i++ )
{
if(x >= gSAZones[i][SAZONE_AREA][0] && x <= gSAZones[i][SAZONE_AREA][3] && y >= gSAZones[i][SAZONE_AREA][1] && y <= gSAZones[i][SAZONE_AREA][4] && z >= gSAZones[i][SAZONE_AREA][2] && z <= gSAZones[i][SAZONE_AREA][5])
{
new tName[MAX_PLAYER_NAME], string[128];
GetPlayerName(pID, tName, MAX_PLAYER_NAME);
format(string, sizeof(string), "%s's current location is: %s", tName, gSAZones[i][SAZONE_NAME]);
SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
}
}
return 1;
}