help again please [ sorry ]
#1

It wont set level
always said

Levels only from 1 - 6
please


Код:
CMD:setlevel(playerid, params[])
{
	if(PInfo[playerid][pAdmin] >= 5)
	{
	    new victimname[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], admlvl, id;
	    if (sscanf(params, "ds", id, admlvl)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /setadmin [id] [adminlevel]");
        if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid Player.");
        if (admlvl > 6 || admlvl < 0) return SendClientMessage(playerid, COLOR_WHITE,"Levels only from 1 - 6");
        
        GetPlayerName(id, victimname, sizeof(victimname));
        GetPlayerName(playerid, adminname, sizeof(adminname));
        new str[128];
        format(str,128,"You have gave admin level %i to %s[ID %d]", admlvl, victimname, id);
        SendClientMessage(playerid, COLOR_WHITE, str);

        format(str,128,"Admin %s[ID %d] gave you admin level %i", adminname, playerid, admlvl);
        SendClientMessage(id, COLOR_WHITE, str);

        format(str,128,"Admin %s[ID %d] has set %s [ID %d] admin level to %i",adminname, playerid, victimname, id, admlvl);
        SendClientMessageToAll(COLOR_WHITE,str);
        
        return PInfo[playerid][pAdmin] = admlvl;
	}
	else return AdminCMD(playerid, 5);
}
Reply
#2

please anyone what should i put in here

Quote:

if (sscanf(params, "ds", id, admlvl)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /setadmin [id] [adminlevel]");

the
Quote:

ds

Reply
#3

You're setting the admlvl as a string. The string character for numbers are different, so just change it from ds to dd.
Reply
#4

umm sorry umm what are the guides?

like
Quote:

ds,dd and etc please give me some guide
Reply
#5

It isn't that hard

pawn Код:
CMD:setlevel(playerid, params[])
{
    if(PInfo[playerid][pAdmin] >= 5)
    {
        new victimname[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], admlvl, id;
        if (sscanf(params, "ud", id, admlvl)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /setadmin [id] [adminlevel]");
        if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_WHITE, "Invalid Player.");
        if (admlvl > 6 || admlvl < 0) return SendClientMessage(playerid, COLOR_WHITE,"Levels only from 1 - 6");

        GetPlayerName(id, victimname, sizeof(victimname));
        GetPlayerName(playerid, adminname, sizeof(adminname));
        new str[128];
        format(str,128,"You have gave admin level %i to %s[ID %d]", admlvl, victimname, id);
        SendClientMessage(playerid, COLOR_WHITE, str);

        format(str,128,"Admin %s[ID %d] gave you admin level %i", adminname, playerid, admlvl);
        SendClientMessage(id, COLOR_WHITE, str);

        format(str,128,"Admin %s[ID %d] has set %s [ID %d] admin level to %i",adminname, playerid, victimname, id, admlvl);
        SendClientMessageToAll(COLOR_WHITE,str);

        return PInfo[playerid][pAdmin] = admlvl;
    }
    else return AdminCMD(playerid, 5);
}
Just "ds" to "ud"
Reply
#6

Quote:
Originally Posted by Artix
Посмотреть сообщение
umm sorry umm what are the guides?

like
Check the Specifiers here https://sampforum.blast.hk/showthread.php?tid=120356
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)