/setscore
#1

How can I make a setscore command? I have the base kinda thing:

pawn Code:
if (strcmp("/setscore", cmdtext, true, 10) == 0)
    {
        if(pInfo[playerid][AdminLevel] < 4)
        {

        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, "Admin Level 4 Only!")
        }
        return 1;
    }
Thanks for your help!
Reply
#2

Use ZCMD instead of strcmp thing.
Reply
#3

Easy with sscanf and zcmd
pawn Code:
CMD:score(playerid, params[])
{
    new id, score, str[84], victimname[28], adminname[28];
    if (pInfo[playerid][pAdminLevel] >= 4)
    {
        if (sscanf(params, "ui", id, score)) return SendClientMessage(playerid, COLOR_LIGHTRED, "USAGE: /score [id] [ammount]");
        if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GRAY, "AdmCmd: This player is not connected.");
        SetPlayerScore(id, score);
        GetPlayerName(id, victimname, 28);
        GetPlayerName(playerid, adminname, 28);
        format(str, 84, "AdmWarn: You've given %s [ID %d] score %d", victimname, id, score);
        SendClientMessage(COLOR_LIGHTBLUE,str);
        format(str,84,"You've received %d score from admin %s [ID %d]", score, adminname, playerid);
        SendClientMessage(id, COLOR_LIGHTBLUE, str);
        return 1;
    }
    else return SendClientMessage(playerid,COLOR_GRAY,"  You don't have authorization!");
}
Reply
#4

I need it in strcmp
Reply
#5

Why not using ZCMD and sscanf??

It's a lot easier. You can see it from command what admantis made.
Reply
#6

Quote:
Originally Posted by xRyder
View Post
Why not using ZCMD and sscanf??
He is just probably lazy to convert his commands, but I had +150 and it only took me 2 hours.

I had a /setscore command in strcmp, but I deleted it, sorry bud.
Reply
#7

Quote:
Originally Posted by admantis
View Post
He is just probably lazy to convert his commands, but I had +150 and it only took me 2 hours.

I had a /setscore command in strcmp, but I deleted it, sorry bud.
I will covert everthing into zcmd I think it looks better anyway! thanks for helping
Reply
#8

Indeed. If you need help , ask. I thought it was hard as well but now I notice its x10 easier than strcmp.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)