help me
#1

HI whene i want to write cmd in my server i write it and nothing happend mybe that is plugin
note: in all commands same bug
pls help fast
this is one coommand:
Код:
COMMAND:setlevel(playerid,params[])
{
    if(!AdminCommandCheck(playerid,"/setlevel"))
        return 1;

	new id,level;
	if(sscanf(params,"ui",id,level))
		return SendSyntaxWarning(playerid,"/setLevel <ID/Name> <Level>");

	if(!IsValidPlayer(id) || level<0)
		return SendSyntaxWarning(playerid,"/setlevel <ID/Name> <Level>");

	if(PlayerInfo[pLoggedIn][id])
	{
		if(PlayerInfo[pAdminLevel][id]<PlayerInfo[pAdminLevel][playerid] || IsPlayerAdmin(playerid))
		{
		    new string[128],string_en[128];
		    if(id!=playerid)
		    {
				format(string,sizeof(string),"<$> -Admininfo-<#> Admin %s hat %s auf Adminlevel %d gestuft!",GetPlayerString(playerid),GetPlayerString(id),level);
				format(string_en,sizeof(string_en),"<$> -Admininfo-<#> Admin %s has leveled %s to adminlevel %d!",GetPlayerString(playerid),GetPlayerString(id),level);
				SendAdminMessage(COLOR_ADMIN,string,string_en,1,id);

				if(GetPlayerLanguage(id)==LANG_DE)
					format(string,sizeof(string),"<$> -Admininfo-<#> Du wurdest von Admin %s auf Adminlevel %d gestuft!",GetPlayerString(playerid),level);
				else
				    format(string,sizeof(string),"<$> -Admininfo-<#> Admin %s has leveled you to adminlevel %d!",GetPlayerString(playerid),level);
				SendClientMessageEx(id,COLOR_ADMIN,string);
			}
			else
			{
			    format(string,sizeof(string),"<$> -Admininfo-<#> Admin %s hat sich auf Adminlevel %d gestuft!",GetPlayerString(playerid),level);
				format(string_en,sizeof(string_en),"<$> -Admininfo-<#> Admin %s has leveled himself to adminlevel %d!",GetPlayerString(playerid),level);
				SendAdminMessage(COLOR_ADMIN,string,string_en,1,INVALID_PLAYER_ID);
			}

			printf("[Level] %s hat %s auf Level %d gestuft!",PlayerName[playerid],PlayerName[id],level);
			PlayerInfo[pAdminLevel][id]=level;
			DOF_SetInt(DOF_File(PlayerName[id]),"level",level);
		}
		else
			SendLanguageMessage(playerid,COLOR_WARNING,"<$> -Warnung-<#> Du kannst das Adminlevel dieses Admins nicht veraendern!","<$> -Warning-<#> You can't change the adminlevel of this admin!");
	}
	else
		SendLanguageMessage(playerid,COLOR_WARNING,"<$> -Warnung-<#> Dieser Spieler ist entweder nicht registriert oder nicht eingeloggt!","<$> -Warning-<#> This player is not registered or logged in!");
	return 1;
}
Reply
#2

use sscanf2 and ZCMD

#include <sscanf2>

#include <ZCMD>

PHP код:
cmd:setlevel(playerid,params[])
{
    if(!
AdminCommandCheck(playerid,"/setlevel"))
        return 
1;
    new 
id,level;
    if(
sscanf(params,"ui",id,level))
        return 
SendSyntaxWarning(playerid,"/setLevel <ID/Name> <Level>");
    if(!
IsValidPlayer(id) || level<0)
        return 
SendSyntaxWarning(playerid,"/setlevel <ID/Name> <Level>");
    if(
PlayerInfo[pLoggedIn][id])
    {
        if(
PlayerInfo[pAdminLevel][id]<PlayerInfo[pAdminLevel][playerid] || IsPlayerAdmin(playerid))
        {
            new 
string[128],string_en[128];
            if(
id!=playerid)
            {
                
format(string,sizeof(string),"<$> -Admininfo-<#> Admin %s hat %s auf Adminlevel %d gestuft!",GetPlayerString(playerid),GetPlayerString(id),level);
                
format(string_en,sizeof(string_en),"<$> -Admininfo-<#> Admin %s has leveled %s to adminlevel %d!",GetPlayerString(playerid),GetPlayerString(id),level);
                
SendAdminMessage(COLOR_ADMIN,string,string_en,1,id);
                if(
GetPlayerLanguage(id)==LANG_DE)
                    
format(string,sizeof(string),"<$> -Admininfo-<#> Du wurdest von Admin %s auf Adminlevel %d gestuft!",GetPlayerString(playerid),level);
                else
                    
format(string,sizeof(string),"<$> -Admininfo-<#> Admin %s has leveled you to adminlevel %d!",GetPlayerString(playerid),level);
                
SendClientMessageEx(id,COLOR_ADMIN,string);
            }
            else
            {
                
format(string,sizeof(string),"<$> -Admininfo-<#> Admin %s hat sich auf Adminlevel %d gestuft!",GetPlayerString(playerid),level);
                
format(string_en,sizeof(string_en),"<$> -Admininfo-<#> Admin %s has leveled himself to adminlevel %d!",GetPlayerString(playerid),level);
                
SendAdminMessage(COLOR_ADMIN,string,string_en,1,INVALID_PLAYER_ID);
            }
            
printf("[Level] %s hat %s auf Level %d gestuft!",PlayerName[playerid],PlayerName[id],level);
            
PlayerInfo[pAdminLevel][id]=level;
            
DOF_SetInt(DOF_File(PlayerName[id]),"level",level);
        }
        else
            
SendLanguageMessage(playerid,COLOR_WARNING,"<$> -Warnung-<#> Du kannst das Adminlevel dieses Admins nicht veraendern!","<$> -Warning-<#> You can't change the adminlevel of this admin!");
    }
    else
        
SendLanguageMessage(playerid,COLOR_WARNING,"<$> -Warnung-<#> Dieser Spieler ist entweder nicht registriert oder nicht eingeloggt!","<$> -Warning-<#> This player is not registered or logged in!");
    return 
1;

Reply
#3

NOt work have more errors
Reply
#4

if you dont mind , post them
Reply
#5

that it is all cmds
Reply
#6

post for me the errors man ... not the commands
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)