SA-MP Forums Archive
Pawno Eroors : - 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: Pawno Eroors : (/showthread.php?tid=355173)



Pawno Eroors : - farCry.xD - 29.06.2012

Код:
D:\Vlad Stuff\rbC\gamemodes\RNSGM.pwn(6914) : error 029: invalid expression, assumed zero
D:\Vlad Stuff\rbC\gamemodes\RNSGM.pwn(6914) : error 017: undefined symbol "cmd_ad"
D:\Vlad Stuff\rbC\gamemodes\RNSGM.pwn(6914) : error 029: invalid expression, assumed zero
D:\Vlad Stuff\rbC\gamemodes\RNSGM.pwn(6914) : fatal error 107: too many error messages on one line
Код:
At the line : COMMAND:ad(playerid, params[])
WHY ??


Re: Pawno Eroors : - JaKe Elite - 29.06.2012

You don't have zcmd.inc download it.


Re: Pawno Eroors : - Jarnu - 29.06.2012

Romel was fast :S
EDIT: and Show the proper code.. thats not enough .


Re: Pawno Eroors : - farCry.xD - 29.06.2012

But , i have zcmd And it is at #include
Here is the rest of the code :
Код:
	COMMAND:ad(playerid, params[])
   {
      new string[500];
      new adstring[124];
      new message[500];
      new playername[MAX_PLAYER_NAME];
      strmid(message, params,0,strlen(params));
      GetPlayerName(playerid, playername, sizeof(playername));
      if(sscanf(params,"u",params[ 0 ]))return SendClientMessage(playerid, COLOR_RED, ""G"||..:: Use "R"/ad "G"["R"text"G"] ::..||");
	  {
      if(antiadspam[playerid] == 0)
	  {
         format(string, sizeof(string), "{FFFF00}[Radio] {00FF19}%s{FFFF00} |..::Message sent by {4764EF} %s (playerid:%d) {FFFF00} pm me!::..|",message, playername, playerid);
         printf(string);
         SendClientMessageToAll(0xADFF2FAA, string);
         GivePlayerMoney(playerid,-2000);
         antiadspam[playerid] = 1;
         SetTimerEx("antispamtimer", ANTIADSPAM_TIME*1000, false, "d", playerid);
		 return 1;
      }
	  else
      {
         format(adstring,sizeof(adstring), ""G"Te rog asteapta "R"%d "G"secunde!", ANTIADSPAM_TIME);
  	     SendClientMessage(playerid, COLOR_RED, adstring );
         return 1;
       }
     }
   }



Re: Pawno Eroors : - JaKe Elite - 29.06.2012

pawn Код:
COMMAND:ad(playerid, params[])
{
    new string[500];
    new adstring[124];
    new message[500];
    new playername[MAX_PLAYER_NAME];
    strmid(message, params,0,strlen(params));
    GetPlayerName(playerid, playername, sizeof(playername));
    if(sscanf(params,"u",params[ 0 ]))return SendClientMessage(playerid, COLOR_RED, ""G"||..:: Use "R"/ad "G"["R"text"G"] ::..||");
    {
        if(antiadspam[playerid] == 0)
        {
            format(string, sizeof(string), "{FFFF00}[Radio] {00FF19}%s{FFFF00} |..::Message sent by {4764EF} %s (playerid:%d) {FFFF00} pm me!::..|",message, playername, playerid);
            printf(string);
            SendClientMessageToAll(0xADFF2FAA, string);
            GivePlayerMoney(playerid,-2000);
            antiadspam[playerid] = 1;
            SetTimerEx("antispamtimer", ANTIADSPAM_TIME*1000, false, "d", playerid);
            return 1;
        }
        else
        {
            format(adstring,sizeof(adstring), ""G"Te rog asteapta "R"%d "G"secunde!", ANTIADSPAM_TIME);
            SendClientMessage(playerid, COLOR_RED, adstring );
            return 1;
        }
    }
    return 1;
}
indent your code next time.


Re: Pawno Eroors : - Cxnnor - 29.06.2012

Never start a code like that.
pawn Код:
COMMAND:ad(playerid, params[])
   {
Always like this.
pawn Код:
COMMAND:ad(playerid, params[])
{



Re: Pawno Eroors : - newbienoob - 29.06.2012

Put your command anywhere, outside of any callbacks.


Re: Pawno Eroors : - farCry.xD - 29.06.2012

I got the same errors Where need I to put the command ? at OnPlayerCommandText , no ?


Re: Pawno Eroors : - newbienoob - 29.06.2012

Put it at the bottom your script.


Re: Pawno Eroors : - DBan - 29.06.2012

Quote:
Originally Posted by farCry.xD
Посмотреть сообщение
I got the same errors Where need I to put the command ? at OnPlayerCommandText , no ?
No, it cannot be under any callback if you are using zcmd.