#1

So I made this command /loc to locate where a player is.
when i do the /loc and id it says

Код:
Boonzay's current location is:idlewood
Boonzay's current location is:los santos
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.

PHP код:
CMD:loc(playeridparams[])
{
    new 
pID;
    if(
sscanf(params"u"pID)) return SendClientMessage(playeridCOLOR_LIGHTGREEN"/loc [playerid]");
    new 
Float:xFloat:yFloat:z;
    
GetPlayerPos(playeridxyz);
    for(new 
0!= sizeof(gSAZones); i++ )
    {
        if(
>= gSAZones[i][SAZONE_AREA][0] && <= gSAZones[i][SAZONE_AREA][3] && >= gSAZones[i][SAZONE_AREA][1] && <= gSAZones[i][SAZONE_AREA][4] && >= gSAZones[i][SAZONE_AREA][2] && <= gSAZones[i][SAZONE_AREA][5])
        {
            new 
tName[MAX_PLAYER_NAME], string[128];
            
GetPlayerName(pIDtNameMAX_PLAYER_NAME);
            
format(stringsizeof(string), "%s's current location is: %s"tNamegSAZones[i][SAZONE_NAME]);
            
SendClientMessage(playeridCOLOR_LIGHTGREENstring);
        }
    }
    return 
1;

if anyone can help me it would be great thanks.
Reply
#2

PHP код:
CMD:loc(playeridparams[]) 

    new 
pID
    if(
sscanf(params"u"pID)) return SendClientMessage(playeridCOLOR_LIGHTGREEN"/loc [playerid]"); 
    new 
Float:xFloat:yFloat:z
    
GetPlayerPos(playeridxyz); 
    for(new 
0!= sizeof(gSAZones); i++ ) 
    { 
        if(
>= gSAZones[i][SAZONE_AREA][0] && <= gSAZones[i][SAZONE_AREA][3] && >= gSAZones[i][SAZONE_AREA][1] && <= gSAZones[i][SAZONE_AREA][4] && >= gSAZones[i][SAZONE_AREA][2] && <= gSAZones[i][SAZONE_AREA][5]) 
        { 
            new 
tName[MAX_PLAYER_NAME], string[128]; 
            
GetPlayerName(pIDtNameMAX_PLAYER_NAME); 
            
format(stringsizeof(string), "%s's current location is: %s"tNamegSAZones[i][SAZONE_NAME]); 
            
SendClientMessage(playeridCOLOR_LIGHTGREENstring); 
            break; 
//quits 'for'
        

    } 
    return 
1

Reply
#3

Thanks bro!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)