SA-MP Forums Archive
In need of help for new cmd - 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: In need of help for new cmd (/showthread.php?tid=506066)



In need of help for new cmd - weedxd - 11.04.2014

Oks so i made this:
PHP код:
dcmd_marryhelp(playerid,params[])
{
    
#pragma unused params
    
if(IsSpawned[playerid] != 1)
    {
        
SendClientMessage(playerid,COLOR_WHITE,"{FF0000}[ERROR]: {FFFFFF}You must be alive and spawned in order to be able to use this command.");
        return 
1;
    }
    if(
IsKidnapped[playerid] == 1)
    {
        
SendClientMessage(playerid,COLOR_WHITE,"{FF0000}[ERROR]: {FFFFFF}You are kidnapped. You cannot use this command.");
        return 
1;
    }
    if(
IsFrozen[playerid] == 1)
    {
        
SendClientMessage(playerid,COLOR_WHITE,"{FF0000}[ERROR]: {FFFFFF}You have been frozen by a Server Administrator. You cannot use this command.");
        return 
1;
    }
    
ShowPlayerDialog(playerid,DIALOG_COMMANDS,DIALOG_STYLE_MSGBOX,"Marriage Commands","{FFFFFF}/marry /maccept /madmit /sex /family","Ok","Cancel");
 return 
1;

When i try to compile it shows me this:
PHP код:
C:\Users\WeeD\Desktop\Samp\gamemodes\SFCRRPG.pwn(16190) : warning 203symbol is never used"dcmd_marryhelp"
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
1 Warning

But the line 16190 is the last one and its empty

Please help me im a newbie in this but im trying as hard as i can but im failing all the time


Re: In need of help for new cmd - Bingo - 11.04.2014

Define this,

pawn Код:
dcmd(marryhelp,9,cmdtext);
If this is already there then you did like this?

pawn Код:
dcmd(dcmd_marryhelp,9,cmdtext);//this is ULTRA WRONG.



Re: In need of help for new cmd - Konstantinos - 11.04.2014

And except the one Patroool mentioned, you need to define (if not already) dcmd:
pawn Код:
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1



Re: In need of help for new cmd - weedxd - 11.04.2014

Quote:
Originally Posted by [vTc]Patroool
Посмотреть сообщение
Define this,

pawn Код:
dcmd(marryhelp,9,cmdtext);
If this is already there then you did like this?

pawn Код:
dcmd(dcmd_marryhelp,9,cmdtext);//this is ULTRA WRONG.
Well but where should i add it becouse i can't find a slot for new cmds to be defined ;/

I dont get it how this could work #define dcmd(marryhelp,9,cmdtext)


Re: In need of help for new cmd - weedxd - 11.04.2014

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
And except the one Patroool mentioned, you need to define (if not already) dcmd:
pawn Код:
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
I have this on 96th lane
PHP код:
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1 



Re: In need of help for new cmd - Konstantinos - 11.04.2014

Add:
pawn Код:
dcmd(marryhelp,9,cmdtext);
in OnPlayerCommandText callback. I posted about the dcmd macro just to be sure in case you had forgot it.


Re: In need of help for new cmd - weedxd - 11.04.2014

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Add:
pawn Код:
dcmd(marryhelp,9,cmdtext);
in OnPlayerCommandText callback. I posted about the dcmd macro just to be sure in case you had forgot it.
THANK YOU SO MUCH! ^.^


Re: In need of help for new cmd - gekas - 11.04.2014

pawn Код:
dcmd(marryhelp,9,cmdtext);
Add this