SA-MP Forums Archive
HELP: /setlevel command - 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: /setlevel command (/showthread.php?tid=424787)



HELP: /setlevel command - Areax - 23.03.2013

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;




Re: HELP: /setlevel command - Misiur - 23.03.2013

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



Re: HELP: /setlevel command - Areax - 23.03.2013

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


Re: HELP: /setlevel command - Areax - 23.03.2013

Still same
Quote:

SERVER: Unknown command




Re: HELP: /setlevel command - Areax - 23.03.2013

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.




Re: HELP: /setlevel command - EiresJason - 23.03.2013

have u included dcmc?


Re: HELP: /setlevel command - Areax - 23.03.2013

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



Re: HELP: /setlevel command - SilverKiller - 23.03.2013

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


Re: HELP: /setlevel command - Areax - 23.03.2013

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


Re: HELP: /setlevel command - EiresJason - 23.03.2013

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?