Command proplem
#1

Hey guys


Please help me in this

pawn Код:
if (!strcmp("/Credits", cmdtext, true, 10) == 0")
    }
        ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "
Server Credits", "Mr.Sanchez For creating this script\nJames_Nick For adding feature's and helping in scripting\nPlease don't remove thoes credits", "Ok", "Back");
         return 1;
}
Errors:

Код:
C:\Users\Admin\Desktop\SD.pwn(277) : error 037: invalid string (possibly non-terminated string)
C:\Users\Admin\Desktop\SD.pwn(277) : warning 215: expression has no effect
C:\Users\Admin\Desktop\SD.pwn(277) : error 001: expected token: ";", but found ")"
C:\Users\Admin\Desktop\SD.pwn(277) : error 029: invalid expression, assumed zero
C:\Users\Admin\Desktop\SD.pwn(277) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Line 277 from the pawn code is
pawn Код:
if (!strcmp("/Credits", cmdtext, true, 10) == 0")
Hope you help me
Reply
#2

pawn Код:
if (strcmp("/Credits", cmdtext, true) == 0)
    {
        ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Server Credits", "Mr.Sanchez For creating this script\nJames_Nick For adding feature's and helping in scripting\nPlease don't remove thoes credits", "Ok", "Back");
         return 1;
}
Reply
#3

if (!strcmp("/Credits", cmdtext, true, 10) == 0")
TO
if (!strcmp("/Credits", cmdtext, true, 10) == 0)
Reply
#4

Thank you for your help but i need 1 more help

Код:
C:\Users\Admin\Desktop\SD.pwn(277) : warning 213: tag mismatch
C:\Users\Admin\Desktop\SD.pwn(280) : warning 217: loose indentation
C:\Users\Admin\Desktop\SD.pwn(605) : error 002: only a single statement (or expression) can follow each "case"
C:\Users\Admin\Desktop\SD.pwn(605 -- 606) : error 028: invalid subscript (not an array or too many subscripts): "listitem"
C:\Users\Admin\Desktop\SD.pwn(605 -- 607) : error 001: expected token: "}", but found "case"
C:\Users\Admin\Desktop\SD.pwn(605 -- 607) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Here's the lines

Note:Those are from that dialog

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    {
    switch(dialogid)
            {
            switch(listitem)
            {
                case 1:
                {
                   SendClientMessage(playerid,COLOR_YELLOW, "Thank you for reading server credits!");
                }
                case 1:
                {
                    SendClientMessage(playerid,COLOR_RED, "You have canceled");
                    return 1;
 }

Thanks again
Reply
#5

Indent CODE, forum blows it.
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{

    switch(dialogid)
    {
    	switch(listitem)
     	{
      	case 0:
       	{
        	SendClientMessage(playerid,COLOR_YELLOW, "Thank you for reading server credits!");
        }
        case 1:
        {
        	SendClientMessage(playerid,COLOR_RED, "You have canceled");
         }
    }

	return 1;
 }
EDIT:MISSED THAT CASE 0
Reply
#6

case starts with 0 then 1 not 1 then another 1
Reply
#7

Quote:
Originally Posted by preda98
Посмотреть сообщение
Indent CODE, forum blows it.
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{

    switch(dialogid)
    {
    	switch(listitem)
     	{
      	case 0:
       	{
        	SendClientMessage(playerid,COLOR_YELLOW, "Thank you for reading server credits!");
        }
        case 1:
        {
        	SendClientMessage(playerid,COLOR_RED, "You have canceled");
         }
    }

	return 1;
 }
EDIT:MISSED THAT CASE 0
Код:
C:\Users\Admin\Desktop\SD.pwn(277) : warning 213: tag mismatch
C:\Users\Admin\Desktop\SD.pwn(280) : warning 217: loose indentation
C:\Users\Admin\Desktop\SD.pwn(605) : error 002: only a single statement (or expression) can follow each "case"
C:\Users\Admin\Desktop\SD.pwn(605 -- 606) : error 028: invalid subscript (not an array or too many subscripts): "listitem"
C:\Users\Admin\Desktop\SD.pwn(605 -- 607) : error 001: expected token: "}", but found "case"
C:\Users\Admin\Desktop\SD.pwn(605 -- 607) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#8

Im Famous! ...
_______________
Emo Girls are sexy.
And You Know it
For them.
_______________
Reply
#9

pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{

    switch(dialogid)
    {
        switch(listitem)
        {
        case 0:
        {
            SendClientMessage(playerid,COLOR_YELLOW, "Thank you for reading server credits!");
        }
        case 1:
        {
            SendClientMessage(playerid,COLOR_RED, "You have canceled");
         }
        }
     }

    return 1;
 }
Reply
#10

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{

    switch(dialogid)
    {
    	switch(listitem)
     	{
      	     case 0:
       	     {
        	        SendClientMessage(playerid,COLOR_YELLOW, "Thank you for reading server credits!");
                 }
                case 1:
                {
        	        SendClientMessage(playerid,COLOR_RED, "You have canceled");
                 }
           }
    }

	return 1;
 }
FORUM MESSES UP MY CODE, JUST INDENT IT.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)