PDA

View Full Version : /i (id) help ++REP


TheMightyEddy
05/04/2012, 03:57 PM
So I need something where when someone types in /i 2 or /i john , it will show the location of a player. I'm using ZCMD too. Is there any way to do this? Thanks

Rep+

[EuG]ZeRoGoD
05/04/2012, 03:58 PM
show location of player o.o thats what map was for tho

ViniBorn
05/04/2012, 04:02 PM
SetPlayerMarkerForPlayer (http://wiki.sa-mp.com/wiki/SetPlayerMarkerForPlayer)

TheMightyEddy
05/04/2012, 04:09 PM
no I already have the players showing on the map. I need this for hits. I need it so when someone types in /i and then the id or user name then it will show the player location in the chat box like this: "Location of [Player Name]: Commerce

ViniBorn
05/04/2012, 05:01 PM
You can use Zones By ~Cueball~ (http://forum.sa-mp.com/showthread.php?t=27598)

TheMightyEddy
05/04/2012, 05:47 PM
it doesn't have the option for you to type in /i . That's all I need. Anyone pls?

ViniBorn
05/04/2012, 06:17 PM
It's just a matter of adapting the work for your needs.


CMD:i(playerid)
{
new ID;
if(sscanf(params, "u", ID))
return SendClientMessage(playerid, -1, "/i [ID/Name]");

new zone[MAX_ZONE_NAME], VBString[64], VBName[MAX_PLAYER_NAME];
GetPlayerName(playerid,VBName,MAX_PLAYER_NAME);
GetPlayer2DZone(playerid, zone, MAX_ZONE_NAME);
format(VBString, sizeof(VBString), "'%s' is at %s.", VBName, zone);
SendClientMessage(playerid,-1,VBString);
return true;
}

TheMightyEddy
05/04/2012, 10:31 PM
It's just a matter of adapting the work for your needs.


CMD:i(playerid)
{
new ID;
if(sscanf(params, "u", ID))
return SendClientMessage(playerid, -1, "/i [ID/Name]");

new zone[MAX_ZONE_NAME], VBString[64], VBName[MAX_PLAYER_NAME];
GetPlayerName(playerid,VBName,MAX_PLAYER_NAME);
GetPlayer2DZone(playerid, zone, MAX_ZONE_NAME);
format(VBString, sizeof(VBString), "'%s' is at %s.", VBName, zone);
SendClientMessage(playerid,-1,VBString);
return true;
}


Hello thanks for your reply but here are the errors I get:

error 017: undefined symbol "params"
error 017: undefined symbol "MAX_ZONE_NAME"
error 029: invalid expression, assumed zero
error 017: undefined symbol "VBString"
fatal error 107: too many error messages on one line

ViniBorn
06/04/2012, 01:49 AM
CMD:i(playerid,params[])
{
new ID;
if(sscanf(params, "u", ID))
return SendClientMessage(playerid, -1, "/i [ID/Name]");

new zone[MAX_ZONE_NAME], VBString[64], VBName[MAX_PLAYER_NAME];
GetPlayerName(playerid,VBName,MAX_PLAYER_NAME);
GetPlayer2DZone(playerid, zone, MAX_ZONE_NAME);
format(VBString, sizeof(VBString), "'%s' is at %s.", VBName, zone);
SendClientMessage(playerid,-1,VBString);
return true;
}

TheMightyEddy
06/04/2012, 04:30 AM
Thank you for trying but I still get this error:

undefined symbol "MAX_ZONE_NAME"
error 029: invalid expression, assumed zero
error 017: undefined symbol "VBString"
fatal error 107: too many error messages on one line

ViniBorn
06/04/2012, 04:54 AM
Really? I try and functioned normally .

I think you didn't put :
#include <zone>

TheMightyEddy
06/04/2012, 02:19 PM
Eh I got it working from another script. Though thanks for all your help and I have +rep'd you! :)