HELP: /setlevel command
#1

Hello!

I have my /setlevel command, but when I go ingame and I type /setlevel it's nothing happend.

CODE:
PHP код:
dcmc_setlevel(playerid,params[])
{
    new 
level,id,file[256],n[MAX_PLAYER_NAME];
    new 
tmp[256], tmp2[256], Index,str[50];
    
tmp strtok(params,Index), tmp2 strtok(params,Index),id strval(tmp),level strval(tmp2);
    
GetPlayerName(id,n,MAX_PLAYER_NAME);
    
format(file,sizeof(file),"/Users/%s.txt",n);
    if(
PlayerInfo[playerid][pAdmin]>= ) return SencClientMessage(palyerid"You have to be admin level 5 to use this command!")
    if(!
strlen(params)) return SendClientMessage(playerid,COL_RED,"USAGE: /setlevel <ID> <Level>");
    if(!
IsPlayerConnected(id))return SendClientMessage(playerid,COL_RED,"ERROR: This player is not online."); 
    
dini_IntSet(file,"Level",level);
    
format(str,sizeof(str),"You have set %s's level to %d",n,level);
    
SendClientMessage(playerid,LIGHTBLUE,str);
    return 
1;

Reply
#2

1. dcmd is discouraged
2.
pawn Код:
dcmc_setlevel => dcmd_setlevel
Reply
#3

Quote:
Originally Posted by Misiur
Посмотреть сообщение
1. dcmd is discouraged
2.
pawn Код:
dcmc_setlevel => dcmd_setlevel
Thanks, let me try it again
Reply
#4

Still same
Quote:

SERVER: Unknown command

Reply
#5

I get this warning when compile:

Quote:

C:\Users\tadej\Desktop\My Server, Don't touch!\gamemodes\TDM.pwn(337) : warning 203: symbol is never used: "dcmd_setlevel"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Warning.

Reply
#6

have u included dcmc?
Reply
#7

Quote:
Originally Posted by EiresJason
Посмотреть сообщение
have u included dcmc?
PHP код:
#include <a_samp>
#include <YSI\y_ini>
#include <zcmd>
#include <dini> 
Reply
#8

pawn Код:
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
At top
Reply
#9

Quote:
Originally Posted by SilverKiller
Посмотреть сообщение
pawn Код:
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
At top
I already have this
Reply
#10

I just noticed in your code that you have dcmc_setlevel instead of dcmd_setlevel.

I haven't used dcmd before so Im not sure if it has to be dcmc.

Edit: just realised that someone just posted that xD did you fix it?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)