SA-MP Forums Archive
/showid or /showlicence help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /showid or /showlicence help (/showthread.php?tid=305000)



/showid or /showlicence help - sherlock - 20.12.2011

I have a command to show the player if he has a licence or not:
pawn Код:
if(strcmp(cmd, "/license", true) == 0)
    {
    if(PlayerInfo[playerid][pLicKey] == 1)
    {
    SendClientMessage(playerid,COLOR_RED," You have License!");
    }
    else
    {
    SendClientMessage(playerid,COLOR_RED," You Dont Have License!");
    }
    return 1;
How could i make it so it is /license [ID] to show to others?


Re: /showid or /showlicence help - kizla - 20.12.2011

pawn Код:
if(strcmp(cmd, "/license", true) == 0)
    {
    new id;
    if(sscanf(params, "u", id))return SendClientMessage(playerid, -1, "Usage: /licenses [ID]");
    if(PlayerInfo[playerid][pLicKey] == 1)
    {
    SendClientMessage(id,COLOR_RED,"Player have license!");
    }
    else
    {
    SendClientMessage(id,COLOR_RED,"Player havent licenses!");
    }
    return 1;
try this... you must have sscanf2


Re: /showid or /showlicence help - Steven82 - 20.12.2011

Quote:
Originally Posted by kizla
Посмотреть сообщение
pawn Код:
if(strcmp(cmd, "/license", true) == 0)
    {
    new id;
    if(sscanf(params, "u", id))return SendClientMessage(playerid, -1, "Usage: /licenses [ID]");
    if(PlayerInfo[playerid][pLicKey] == 1)
    {
    SendClientMessage(id,COLOR_RED,"Player have license!");
    }
    else
    {
    SendClientMessage(id,COLOR_RED,"Player havent licenses!");
    }
    return 1;
try this... you must have sscanf2
That may work, but i honestly don't see the point of using sscanf with strcmp. Why not just upgrade two notches to ZCMD. And if you want to keep it simple just use dcmd with sscanf. All you have to do to use dcmd is just include a define.


Re: /showid or /showlicence help - kizla - 20.12.2011

pawn Код:
CMD:license(playerid, params[])
{
    new id;
    if(sscanf(params, "u", id))return SendClientMessage(playerid, -1, "Usage: /licenses [ID]");
    if(PlayerInfo[playerid][pLicKey] == 1)
    {
        SendClientMessage(id,COLOR_RED,"Player have license!");
    }
    else
    {
        SendClientMessage(id,COLOR_RED,"Player havent licenses!");
    }
    return 1;
}
no problem, here is in ZCMD


Re: /showid or /showlicence help - sherlock - 20.12.2011

TY all.