SA-MP Forums Archive
2error's - 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: 2error's (/showthread.php?tid=363409)



2error's - Tuntun - 27.07.2012

F:\test.pwn(3) : error 010: invalid function or declaration
F:\test.pwn(6) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.

What Wrong Here:
Код:
#include <a_samp>

if (strcmp("/rules", cmdtext, true, 10) ==0)
	{
        ShowPlayerDialog(playerid,100,DIALOG_STYLE_MSGBOX,"{FF0000}.: RULES :.","{FFFFFF}1.Must Follow The {FFFF00}Rules\n2.No car {FFFF00}ramming !\n3.No{FFFF00} Mod/Cleo/Soibet/Hacking/Cheating - {FF0000}NOT ALLOWED! \n4.Respect The {0000FF}Admin and Another {FFFF00}Player!\n5.{FF0000}Report {FFFFFF} if you see {FF0000}cheaters/hackers! {FFFFFF}use /report [id] [reason] ","Accept","Exit");
        return 1;
   }



Re: 2error's - TheDeath - 27.07.2012

You must put that into
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    return 0;
}
and remove the return 1;


Re: 2error's - Tuntun - 27.07.2012

#include <a_samp>

if (strcmp("/rules", cmdtext, true, 10) ==0)
{
ShowPlayerDialog(playerid,100,DIALOG_STYLE_MSGBOX, "{FF0000}.: RULES :.","{FFFFFF}1.Must Follow The {FFFF00}Rules\n2.No car {FFFF00}ramming !\n3.No{FFFF00} Mod/Cleo/Soibet/Hacking/Cheating - {FF0000}NOT ALLOWED! \n4.Respect The {0000FF}Admin and Another {FFFF00}Player!\n5.{FF0000}Report {FFFFFF} if you see {FF0000}cheaters/hackers! {FFFFFF}use /report [id] [reason] ","Accept","Exit");
return 1;
}
Add Here please than give me..


Re: 2error's - Roko_foko - 27.07.2012

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/rules", cmdtext, true, 10) ==0)
    {
        ShowPlayerDialog(playerid,100,DIALOG_STYLE_MSGBOX,"{FF0000}.: RULES :.","{FFFFFF}1.Must Follow The {FFFF00}Rules\n2.No car {FFFF00}ramming !\n3.No{FFFF00} Mod/Cleo/Soibet/Hacking/Cheating - {FF0000}NOT ALLOWED! \n4.Respect The {0000FF}Admin and Another {FFFF00}Player!\n5.{FF0000}Report {FFFFFF} if you see {FF0000}cheaters/hackers! {FFFFFF}use /report [id] [reason] ","Accept","Exit");
        return 1;
    }
    return 0;
}
As TheDeath said.


Re: 2error's - Devilxz97 - 27.07.2012

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/rules", cmdtext, true, 10) ==0)
    {
        ShowPlayerDialog(playerid,100,DIALOG_STYLE_MSGBOX,"{FF0000}.: RULES :.","{FFFFFF}1.Must Follow The {FFFF00}Rules\n2.No car {FFFF00}ramming !\n3.No{FFFF00} Mod/Cleo/Soibet/Hacking/Cheating - {FF0000}NOT ALLOWED! \n4.Respect The {0000FF}Admin and Another {FFFF00}Player!\n5.{FF0000}Report {FFFFFF} if you see {FF0000}cheaters/hackers! {FFFFFF}use /report [id] [reason] ","Accept","Exit");
        return 1;
    }
    return 1; //change this to 1
}
u need to change it to return 1; because when u use some commands it will show u Server unknown commands .
but the commands that u use i work perfectly ! . .


Re: 2error's - Alexis1999 - 27.07.2012

Quote:
Originally Posted by Devilxz97
Посмотреть сообщение
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/rules", cmdtext, true, 10) ==0)
    {
        ShowPlayerDialog(playerid,100,DIALOG_STYLE_MSGBOX,"{FF0000}.: RULES :.","{FFFFFF}1.Must Follow The {FFFF00}Rules\n2.No car {FFFF00}ramming !\n3.No{FFFF00} Mod/Cleo/Soibet/Hacking/Cheating - {FF0000}NOT ALLOWED! \n4.Respect The {0000FF}Admin and Another {FFFF00}Player!\n5.{FF0000}Report {FFFFFF} if you see {FF0000}cheaters/hackers! {FFFFFF}use /report [id] [reason] ","Accept","Exit");
        return 1;
    }
    return 1; //change this to 1
}
u need to change it to return 1; because when u use some commands it will show u Server unknown commands .
but the commands that u use i work perfectly ! . .
You can't change the return value on that callback. It's like returning a value the equals with text and not a command

Here's the correct syntax.
pawn Код:
#define DIALOG_RULES 8000

public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/rules", true))
    {
        ShowPlayerDialog(playerid,DIALOG_RULES,DIALOG_STYLE_MSGBOX,"{FF0000}.: RULES :.","{FFFFFF}1.Must Follow The {FFFF00}Rules\n2.No car {FFFF00}ramming !\n3.No{FFFF00} Mod/Cleo/Soibet/Hacking/Cheating - {FF0000}NOT ALLOWED! \n4.Respect The {0000FF}Admin and Another {FFFF00}Player!\n5.{FF0000}Report {FFFFFF} if you see {FF0000}cheaters/hackers! {FFFFFF}use /report [id] [reason] ","Accept","Exit");
        return 1;
    }
    return 0;
}



Re: 2error's - nton - 27.07.2012

i make it for you
PHP код:
#include <a_samp>
public OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp("/rules"cmdtexttrue10) == 0)
    {
    
ShowPlayerDialog(playerid8000DIALOG_STYLE_MSGBOX,"{FF0000}.: RULES :." "{FFFFFF}1.Must Follow The {FFFF00}Rules\n2.No car {FFFF00}ramming !\n3.No{FFFF00} Mod/Cleo/Soibet/Hacking/Cheating - {FF0000}NOT ALLOWED! \n4.Respect The {0000FF}Admin and Another {FFFF00}Player!\n5.{FF0000}Report {FFFFFF} if you see {FF0000}cheaters/hackers! {FFFFFF}use /report [id] [reason] ""Accept""Exit");
    return 
1;
    }
    return 
0;
 }
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
   if(
dialogid == 8000){
   }
   return 
0;