Did you tried even to compile this script? it won't work btw because you're using
GetPlayer2DZone function, and you didn't even define the
include at all plus you're using outdated ways
Here's a simple way to do it, using zcmd,sscanf
pawn Code:
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#include <a_zones> //http://pastebin.com/f68e1a6ad
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" GPS Script loaded");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
CMD:gps(playerid,params[])
{
new id,string[64],zone[MAX_ZONE_NAME],pName[MAX_PLAYER_NAME];
//if(!IsPlayerCop(playerid)) return SendClientMessage(playerid,-1,"You need to be a cop to use this feature");
if(sscanf(params,"u",id)) return SendClientMessage(playerid,-1,"Syntax: /gps [playerid]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"This player is not connected at the moment");
GetPlayerName(id,pName,MAX_PLAYER_NAME);
GetPlayer2DZone(playerid, zone, MAX_ZONE_NAME);
format(string,sizeof(string),"%s(%d) is currently at %s",pName,id,zone);
SendClientMessage(playerid,-1,string);
return 1;
}
Anyways, nice attempt try to make it better in the next release.