i need /setlevel command
#1

hello, i need /setlevel command to be like this

Usage: /setlevel [playerid] [level]

and give the message to him with no sscanf2 i dont need it

i have /admins command if you want it for something

CMD:admins(playerid,params[])
{
new Count = 0;
new string[100], n[MAX_PLAYER_NAME];
SendClientMessage(playerid, 0x00FF00FF, "{5EFF00}__________|- Online Admins -|__________");
SendClientMessage(playerid, 0xFF0000FF, " ");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][Level] > 0)
{
GetPlayerName(i,n,sizeof(n));
format(string,sizeof(string),"Level %d: %s (ID: %d) - %s", PlayerInfo[i][Level], n, i, GetRankFromLevel(i));
SendClientMessage(playerid, 0xFF0000FF, string);
Count++;
}
}
if(Count == 0)
{
SendClientMessage(playerid, 0xFF0000FF, "No admin online in the list");
}
SendClientMessage(playerid, 0x00FF00FF, "____________________________");
return 1;
}

stock GetRankFromLevel(playerid)
{
new Rank[40];
switch(PlayerInfo[playerid][Level])
{
case 0:
{
Rank = "Regular Player";
}
case 1:
{
Rank = "{FFA500}Trial Administrator";
}
case 2:
{
Rank = "{008000}Junior Moderator";
}
case 3:
{
Rank = "{FFFF00}Super Moderator";
}
case 4:
{
Rank = "{32CD32}Administrator";
}
case 5:
{
Rank = "{00A6FF}Master Administrator";
}
case 6:
{
Rank = "{00A6FF}Professional Administrator";
}
case 7:
{
Rank = "{FF0000}Delta Administrator";
}
case 8:
{
Rank = "{FF0000}Alfa Administrator";
}
case 9:
{
Rank = "{FF0000}Scripter";
}
case 10:
{
Rank = "{FF0000}Corporate";
}
}
return Rank;
}

pls do something
Reply
#2

PHP код:
CMD:setlevelplayeridparams[ ] )
{
    
gsString] = EOS;

    
LevelCheckplayerid10 );

    new
        
Player,
        
aLevel
    
;
    if ( 
sscanfparams"ui"PlayeraLevel ) )
        return 
SendClientMessageplayeridCOLOR_ULTRARED"{FF0000}» {DB881A}USAGE: {33CCFF}/setlevel [PlayerID] [Level]" );

    if ( !
IsPlayerConnectedPlayer ) && Player == INVALID_PLAYER_ID )
        return 
SendErrorplayerid"Player not connected!" );

    if ( 
PlayerInfoPlayer ][ LoggedIn ] == )
        return 
SendErrorplayerid"Player must be registered and logged in!" );

    if ( 
aLevel 10 )
        return 
SendErrorplayerid"Incorrect Level" );

    if ( 
aLevel == PlayerInfoPlayer ][ Level ] )
        return 
SendErrorplayerid"Player is already have this level" );

    if ( 
aLevel )
        
formatgsStringsizeofgsString ), "{FFFF00}- AS - {FF0000}Administrator %s has set you to administrator status [Level: %d]"PlayerNameplayerid ), aLevel );
    else
        
formatgsStringsizeofgsString ), "Administrator %s has set you to player status [Level: %d]"PlayerNameplayerid ), aLevel );
    
PlayerInfo[Player][TextColor] = 16758883;
    
SendClientMessagePlayerCOLOR_ABLUEgsString );

    if ( 
aLevel PlayerInfoPlayer ][ Level ] )
        
AnnouncePlayer"~g~Promoted!"2000);
    else
        
AnnouncePlayer,"~r~Demoted"2000);
    
format(gsQuery,sizeof(gsQuery),"UPDATE `accounts` SET `IDColor` = ' -1778384641'  WHERE `id` = '%d'",PlayerInfoplayerid ][ AccID ]);
    
mysql_querygsQueryTHREAD_NONEPlayer );
    
PlayerInfo[Player][IdColor] = -1778384641;
    
UpdateStatusPlayer );
    
FormatMSGplayeridCOLOR_ABLUE"You have made %s Level %d on %s"PlayerNamePlayer ), aLevelzDate( ) );

    
formatgsStringsizeofgsString ),"Administrator %s has made %s Level %d"PlayerNameplayerid ), PlayerNamePlayer ), aLevel );
    
SaveToFile"AdminLog"gsString );
    
PlayerInfoPlayer ][ Level ] = aLevel;

    
PlayerPlaySoundPlayer10570.00.00.0 );
    return ( 
);

Reply
#3

PHP код:
CMD:setlevel(playeridparams[])
{
    
SendClientMessage(playerid, -1"This is my setlevel command.");
    return 
1;

This is not the place for requests. Ask here: https://sampforum.blast.hk/showthread.php?tid=447813
Reply
#4

Код:
CMD:setlevel(playerid, params[])
{
	new id, level, string[256];
	if(IsPlayerConnected(playerid))
	{
		if(PlayerInfo[playerid][Leve] < 10) return SCM(playerid, -1, You are not authorized!);
		if(sscanf(params, "ui", id, level)) return SCM(playerid, -1, "Usage: /setlevel <playerid/player name> <level>");
		{
			if(id == INVALID_PLAYER_ID) return SCM(playerid, -1, "Player not connected!");
			PlayerInfo[id][Level] = level;
			format(string, 256, "You have promoted to level %d admin!", level);
			SCM(id, -1, string);
		}
	}
	return 1;
}
Reply
#5

i corrected them and did it like this:

CMDetlevel(playerid, params[])
{
new id, level, string[256];
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][Level] < 10) return SendClientMessage(playerid, 0xFF0000FF, "You are not authorized!");
if(sscanf(params, "ui", id, level)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /setlevel [playerid] [level]");
{
if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000FF, "Player not connected!");
PlayerInfo[id][Level] = level;
format(string, 256, "You have promoted to level %d admin!", level);
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
SendClientMessage(id, 0x00A6FF, string);
}
}
return 1;
}

compiled it and added sscanf2 #include <sscanf2> but when i tried to open SAMP-server i got this:

----------

SA-MP Dedicated Server
----------------------
v0.3.7-R2, ©2005-2015 SA-MP Team


Server Plugins
--------------
Loaded 0 plugins.


Started server on port: 7777, with maxplayers: 100 lanmode is ON.


Filterscripts
---------------
Loading filterscript 'Turbo.amx'...
[Welcome]
Loading filterscript 'Animation.amx'...

--------------------------------------
Anim System loaded by [iE]ZoneKiller
--------------------------------------

Loaded 2 filterscripts.

Script[gamemodes/scriptingm.amx]: Run time error 19: "File or function is not found"
Number of vehicle models: 0

pls help me maybe i have wrong sscanf2?
Reply
#6

server Plugins
--------------
0 loaded plugins.
You plugins? Download sscanf and chicken include sites in GM #include <sscanf> and compiles
Reply
#7

look, just tell me step by step what must i do pls
Reply
#8

look, if i must download the link, pls show me the link of it to download. then let's continue what must i do
Reply
#9

Good for download beginning sscanf2 on this site:
http://www81.zippyshare.com/v/Enpl5VwH/file.html

Step 1: Insert the file in pawno -> includes
Step 2: Enter the Gamemode write #include <sscanf2>
Compile and start the Gamemode
Reply
#10

Quote:
Originally Posted by skuller12
Посмотреть сообщение
server Plugins
--------------
0 loaded plugins.
You plugins? Download sscanf and chicken include sites in GM #include <sscanf> and compiles
I laughed when I saw the bolded sentence^
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)