SA-MP Forums Archive
*** This topic title is not descriptive. - 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: *** This topic title is not descriptive. (/showthread.php?tid=390493)



*** This topic title is not descriptive. - Private200 - 06.11.2012

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[256], idx;
    cmd = strtok(cmdtext, idx);
    dcmd(register,8,cmdtext);
    dcmd_register(playerid,params[])
    
    new file[256],n[MAX_PLAYER_NAME];
    GetPlayerName(playerid,n,MAX_PLAYER_NAME);
    format(file,sizeof(file),"VIP SYSTEM/Users/%s.txt",n);
	return 1;
}
Help required , here codes are

Код:
C:\Documents and Settings\Private200\Desktop\Vip system\filterscript\Vip system UC.pwn(76) : error 017: undefined symbol "dcmd_register"
C:\Documents and Settings\Private200\Desktop\Vip system\filterscript\Vip system UC.pwn(77) : error 017: undefined symbol "dcmd_register"
C:\Documents and Settings\Private200\Desktop\Vip system\filterscript\Vip system UC.pwn(79) : error 001: expected token: ";", but found "new"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
dcmd has been included ..
rep+


Re: Help with a script - YoYo123 - 06.11.2012

Try this
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(register,8,cmdtext);
   
    new file[256],n[MAX_PLAYER_NAME];
    GetPlayerName(playerid,n,MAX_PLAYER_NAME);
    format(file,sizeof(file),"VIP SYSTEM/Users/%s.txt",n);
    return 1;
}
If you don't know how to work with dcmd put the dcmd_command outside any callback.


Re: Help with a script - Private200 - 06.11.2012

C:\Documents and Settings\Private200\Desktop\Vip system\filterscript\Vip system UC.pwn(74) : error 017: undefined symbol "dcmd_register"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.


Re: Help with a script - YoYo123 - 06.11.2012

You need to know how to use dcmd first..
First thing you need is the #define line at the top of the script:
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
After that you need to define every command you will use in OnPlayerCommandText like that:
pawn Код:
OnPlayerCommandText(playerid, cmdtext[])
{  
    dcmd(register, 8, cmdtext);
}
Note that the second parameter is the number of characters in the cmd without the '/'.
After defining that, you need to create the command function anywhere outside callbacks like this:
pawn Код:
dcmd_register(playerid, params[])
{
  //Code goes here
  return 1;
}