27.04.2015, 05:34
Don't just copy paste the format of GetPlayerCountry() and other functions, you have to put the name of string in place of string[]
And also just use 'u' parameter in sscanf, don't use 'd'.
So use this :
And also just use 'u' parameter in sscanf, don't use 'd'.
So use this :
PHP код:
CMD:geo(playerid, params[])
{
new string[128], playa, geo[50], geo2[50], geo3[50];//geo, geo2 and geo3 should be string
if(sscanf(params, "u", playa))//only 'u' here
{
SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /geo [player]");
return 1;
}
if (PlayerInfo[playerid][pAdmin] >= 4)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
GetPlayerCountry(playerid, geo);//see changes here
GetPlayerISP(playerid, geo2);//see changes here
GetPlayerCity(playerid, geo3);//see changes here
format(string, sizeof(string), "Looking up %s's GEO.. COUNTRY:%s ISP:%S CITY:%s .", GetPlayerNameEx(playa), geo, geo2, geo3);
SendClientMessageEx(playerid, COLOR_WHITE, string);
}
}
}
else
{
Invalid_Admin(playerid);
}
return 1;
}