SA-MP Forums Archive
DCMD HELP [+REP} - 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: DCMD HELP [+REP} (/showthread.php?tid=312623)



DCMD HELP [+REP} - James Coral - 22.01.2012

Hey all i wanted do add:
Код:
/adsf 
/adunsf
in SFCNRRPG

my dcmd code is here
pawn Код:
dcmd(adsf,6,cmdtext);
dcmd(adunsf,7,cmdtext);
But it says that its Unknow Command ):

wtf?


Respuesta: DCMD HELP [+REP} - [Nikk] - 22.01.2012

and the dcmd_asdf and dcmd_adunsf ?


Re: DCMD HELP [+REP} - James Coral - 22.01.2012

Here:
pawn Код:
dcmd_adsf(playerid,params[])
{
    new string[128];
    new ID;
    if(sscanf(params,"ui",ID))
    {
        SendClientMessage(playerid,COLOR_ERROR,"USAGE: /adsf (Player Name/ID)");
        return 1;
    }
    if(!IsPlayerConnected(ID))
    {
        format(string,sizeof(string),"The player ID (%d) is not connected to the server. You cannot give them SF status.",ID);
        SendClientMessage(playerid,COLOR_ERROR,string);
        return 1;
    }
    if(PLAYERLIST_authed[ID] != 1)
    {
        format(string,sizeof(string),"%s(%d) is not logged into to the server. You must wait till they login before you give them SF status.",PlayerName(ID),ID);
        SendClientMessage(playerid,COLOR_ERROR,string);
        return 1;
    }
    if(CanUseSF[ID] == 1337)
    {
        format(string,sizeof(string),"%s(%d) is already a SF member.",PlayerName(ID),ID);
        SendClientMessage(playerid,COLOR_ERROR,string);
        return 1;
    }
    format(string,sizeof(string),"[ADMIN SF] Administrator has given %s(%d) SF status.",PlayerName(ID),ID);
    SendClientMessageToAll(COLOR_ADMIN,string);

    SendClientMessage(ID,COLOR_ADMIN,"You have been given SF status by a Server Administrator. Congratulations.");
    CanUseCIA[ID] =1337;

    format(string,sizeof(string),"9[ADMIN SF] Administrator has given %s(%d) SF status.",PlayerName(ID),ID);
    IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
    return 1;
}
And /adunsf is here:

pawn Код:
dcmd_adunsf(playerid,params[])
{
    new string[128];
    new ID;
    if(sscanf(params,"ui",ID))
    {
        SendClientMessage(playerid,COLOR_ERROR,"USAGE: /adunsf (Player Name/ID)");
        return 1;
    }
    if(!IsPlayerConnected(ID))
    {
        format(string,sizeof(string),"The player ID (%d) is not connected to the server. You cannot take their CIA status.",ID);
        SendClientMessage(playerid,COLOR_ERROR,string);
        return 1;
    }
    if(PLAYERLIST_authed[ID] != 1)
    {
        format(string,sizeof(string),"%s(%d) is not logged into to the server. You must wait till they login before you take their SF status.",PlayerName(ID),ID);
        SendClientMessage(playerid,COLOR_ERROR,string);
        return 1;
    }
    if(CanUseSF[ID] != 1337)
    {
        format(string,sizeof(string),"%s(%d) is not a SF member.",PlayerName(ID),ID);
        SendClientMessage(playerid,COLOR_ERROR,string);
        return 1;
    }
    format(string,sizeof(string),"[ADMIN UNSF] Administrator has taken %s(%d)'s SF status.",PlayerName(ID),ID);
    SendClientMessageToAll(COLOR_ADMIN,string);

    SendClientMessage(ID,COLOR_ADMIN,"Your SF status has been taken away from you by a Server Administrator. Unlucky.");
    CanUseSF[ID] =0;

    format(string,sizeof(string),"9[ADMIN UNSF] Administrator has taken %s(%d)'s CIA status.",PlayerName(ID),ID);
    IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
    return 1;
}



Re: DCMD HELP [+REP} - Guest9328472398472 - 22.01.2012

Show the whole command. So we can see what errors might have mistakenly popped up.


Re: DCMD HELP [+REP} - James Coral - 22.01.2012

Check up Dude... i posted already the code
btw its dont give eny errors/warnings


Re: DCMD HELP [+REP} - Guest9328472398472 - 22.01.2012

Quote:
Originally Posted by James Coral
Посмотреть сообщение
Check up Dude... i posted already the code
btw its dont give eny errors/warnings
The command is not proceeding nothing, especially how it's not returning...therefor it's gonna say unknown command till you script it to do something.

EDIT: Do what joker said


Re: DCMD HELP [+REP} - MasterJoker - 22.01.2012

lol brandon and james has the same time reply!

ONTOPIC:

try removing those return 1; except the return 1; the last one below


Re: DCMD HELP [+REP} - Da' J' - 22.01.2012

Same came to me, after only editing a command... Strange.


Re: DCMD HELP [+REP} - Guest9328472398472 - 22.01.2012

Are you sure the dcmd inc is input into your includes folder?

Cuz this is strange...


Re: DCMD HELP [+REP} - James Coral - 22.01.2012

Quote:
Originally Posted by MasterJoker
Посмотреть сообщение
lol brandon and james has the same time reply!

ONTOPIC:

try removing those return 1; except the return 1; the last one below
Dude i cant remove it! its says that the value is wrong ):