zyx location
#1

Is it somehow possible to get the player's position, so like location instead of xyz?
PHP код:
CMD:getplayerpos(playeridparams[])
{
    if(
PlayerInfo[playerid][AdminLevel] < 1) return 0;
    if(
PlayerInfo[playerid][AdminLevel] < 3) return SendClientMessage(playeridCOLOR_YELLOWGREEN"Error: You are not authorized to use this command.");
    new 
string[75], targetplayerpName[MAX_PLAYER_NAME], pName2[MAX_PLAYER_NAME], Float:XFloat:YFloat:Z;
    if(
sscanf(params"u"targetplayer)) return SendClientMessage(playeridCOLOR_ORANGE"Usage: /getplayerpos [ID]");
    if(!
IsPlayerConnected(targetplayer)) return SendClientMessage(playeridCOLOR_RED"Error: Player is not connected!");
    
GetPlayerPos(targetplayerFloat:XFloat:YFloat:Z);
    
GetPlayerName(playeridpNameMAX_PLAYER_NAME);
    
GetPlayerName(targetplayerpName2MAX_PLAYER_NAME);
    
format(stringsizeof string"%s's position is 'X'%f 'Y'%f Z'%f'"pName2Float:XFloat:YFloat:Z);
    
SendClientMessage(playeridCOLOR_LIGHTGREENstring);
    
printf("[Getplayerpos] %s has used this command"pName);
    return 
1;

Reply
#2

You mean, something like "Los Santos" or "Idlewood"?
Reply
#3

Exactly
Reply
#4

you have to create these zones first, then give a name to every single one, make a function that gets players position and checks in which zone player is.
check out this thing: https://sampforum.blast.hk/showthread.php?tid=147

edit: or use this include, i'm using it myself and it's pretty nice
http://www81.zippyshare.com/v/pJsARB7A/file.html
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)