Posts: 303
Threads: 71
Joined: Mar 2011
Код:
CMD:loc(playerid, params[])
{
if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "Usage: /loc [id]");
new
pID = strval(params),
zName[64] = "Unknown Location",
iStr[128];
if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_RED, "Invalid ID or the User is Not Online.");
GetPlayerInZone(pID, zName, 64);
format(iStr, sizeof(iStr), "Location of %s(%d): %s", pName(pID), pID, zName);
SendClientMessage(playerid, G, iStr);
return 1;
}
As you see my above code shows the location of a player. But I can only type /loc [id] to see the location of a player. Is there a way to also use /info or /location or /i to show the location without typing the whole code multiple times with different commands? +REP!
Posts: 303
Threads: 71
Joined: Mar 2011
Posts: 303
Threads: 71
Joined: Mar 2011
Quote:
Originally Posted by Rob_Maate
As the above posted, just place a whole heap of variants directly above your command.
pawn Код:
CMD:i(playerid, params[]) return cmd_information(playerid, params); CMD:in(playerid, params[]) return cmd_information(playerid, params); CMD:info(playerid, params[]) return cmd_information(playerid, params); CMD:loc(playerid, params[]) return cmd_information(playerid, params); CMD:location(playerid, params[]) return cmd_information(playerid, params); CMD:information(playerid, params[]) { //Funky Town return 1; }
|
Even better! +REP for you too!