/showid or /showlicence help
#1

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?
Reply
#2

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
Reply
#3

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.
Reply
#4

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

TY all.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)