2 commands in 1 +REP!
#1

Код:
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!
Reply
#2

pawn Код:
COMMAND:info(playerid,params[])
{
  return cmd_loc(playerid,params);
}
pawn Код:
COMMAND:i(playerid,params[])
{
   return cmd_loc(playerid,params);
}
Reply
#3

Works! Thanks! +rep
Reply
#4

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;
}
Reply
#5

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!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)