SA-MP Forums Archive
help again please [ sorry ] - 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: help again please [ sorry ] (/showthread.php?tid=306032)



help again please [ sorry ] - Artix - 24.12.2011

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);
}



Re: help again please [ sorry ] - Artix - 24.12.2011

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




Re: help again please [ sorry ] - [HiC]TheKiller - 24.12.2011

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


Re: help again please [ sorry ] - Artix - 24.12.2011

umm sorry umm what are the guides?

like
Quote:

ds,dd and etc please give me some guide



Re: help again please [ sorry ] - Jakku - 24.12.2011

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"


Re: help again please [ sorry ] - Dark_Kostas - 24.12.2011

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