loc command
#1

Hello,i've maked this loc command. (Show location of player)

pawn Код:
CMD:loc(playerid, params[])
{
if(IsSpawned[playerid] == 0) return SendClientMessage(playerid,0xFF0000FF,"You can't use this command when you are dead or spawning.");
if(isnull(params))return SendClientMessage(playerid, 0xFF0000FF, "Usage: /loc [playerid]");
new target, current_zone;
current_zone = player_zone[target];
if(current_zone != -1 && IsPlayerConnected(target)) {
new playername[MAX_PLAYER_NAME],message2[170];
GetPlayerName(target,playername,MAX_PLAYER_NAME);
format(message2,sizeof(message2),"%s(%d)'s current location: %s",playername,target,zones[current_zone][zone_name]);
SendClientMessage(playerid,0x00C7FFAA,message2);
} else {
SendClientMessage(playerid,red,"Invalid Player ID");
}
return true;
}
I've some problems.

It shows location ONLY at id 0,so if i type /loc 1,2,3 etc... it shows only player id 0 location.
If i type an invalid id (ex: player offline),it shows again id 0.

What's wrong?
Reply


Messages In This Thread
loc command - by Face9000 - 10.02.2012, 22:56
Re: loc command - by SnG.Scot_MisCuDI - 10.02.2012, 23:05
Re: loc command - by Face9000 - 10.02.2012, 23:22
Re: loc command - by Nuke547 - 10.02.2012, 23:54
Re: loc command - by SnG.Scot_MisCuDI - 11.02.2012, 00:06
Re: loc command - by Tanush123 - 11.02.2012, 00:52
Re: loc command - by SnG.Scot_MisCuDI - 11.02.2012, 15:50
Re: loc command - by Twisted_Insane - 11.02.2012, 16:09

Forum Jump:


Users browsing this thread: 1 Guest(s)