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


Messages In This Thread
2 commands in 1 +REP! - by TheMightyEddy - 06.04.2012, 04:59
Re: 2 commands in 1 +REP! - by Cjgogo - 06.04.2012, 05:03
Re: 2 commands in 1 +REP! - by TheMightyEddy - 06.04.2012, 13:57
Re: 2 commands in 1 +REP! - by Rob_Maate - 06.04.2012, 14:08
Re: 2 commands in 1 +REP! - by TheMightyEddy - 06.04.2012, 14:24

Forum Jump:


Users browsing this thread: 1 Guest(s)