Need help.. ERRORS!
#1

How to fix this

pawn Код:
if (strcmp("/help",cmdtext,true,10) == 0)
{
   ShowPlayerDialog(playerid, 4, DIALOG_STYLE_MSGBOX,"Welcome To BattleField IV","Objectives:\n   PAK: You need to kill your enemy (USA) and place a C4 near Control Center in your enemy base\n   USA: You need to kill your enemy (PAK) and place  C4 near AirForces\nCommands:\n   /kill - To kill yourself\n   /ct - To change your class\n   /login - To login to your account\n   /stats [id] - see others stats. you can see your stats too by using only /stats without id\n   /admins - To see online admins\n   /vip - To see online Vips\n   /report - To report player to online admins\n   /changepass [new password] - To change your password","Ok","");
   return 1;
}else return SendClientMessage(playerid, COLOR_RED,"[ERROR] You entered wrong command, Type /help");
ERRORS:
Код:
C:\Users\toshiba\Desktop\C&R\gamemodes\gamemode.pwn(267) : error 075: input line too long (after substitutions)
C:\Users\toshiba\Desktop\C&R\gamemodes\gamemode.pwn(268) : error 037: invalid string (possibly non-terminated string)
C:\Users\toshiba\Desktop\C&R\gamemodes\gamemode.pwn(268) : error 029: invalid expression, assumed zero
C:\Users\toshiba\Desktop\C&R\gamemodes\gamemode.pwn(268) : error 017: undefined symbol "n"
C:\Users\toshiba\Desktop\C&R\gamemodes\gamemode.pwn(268) : fatal error 107: too many error messages on one line

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


5 Errors.
Reply
#2

What is the error?
And,
pawn Код:
if (strcmp("/help",cmdtext,true,10) == 0)
The no. 10 over here should be 5 coz it's the no. of characters in the command which is 5.
Reply
#3

Quote:
Originally Posted by Faisal_khan
Посмотреть сообщение
What is the error?
And,
pawn Код:
if (strcmp("/help",cmdtext,true,10) == 0)
The no. 10 over here should be 5 coz it's the no. of characters in the command which is 5.
Sorry forgot to put the errors XD

and i will use like this

pawn Код:
if(!strcmp("/help",cmdtext,true))
or
if(!strcmp("/help",cmdtext))
Reply
#4

Input line too long, then use strcat, search it on wiki.sa-mp.com.
Reply
#5

Wokey!
Reply
#6

Just learnt about this from BalluMiaa
Quote:

I also use strcat to attach two strings but i got something better and way more easy which is "\" symbol. Whenever you want to part one string into a new line like a function just use this symbol in the end and start writing the next part of the string in the next line and close the quotes so that it will be a proper string.

Like " Holla faisal \
Holla mate i can enter same string in new line "

No error of input line too long and saves more time , no need to strcat two strings together. Saves lot of memory too.
Reply
#7

What Faisal_khan says:
pawn Код:
ShowPlayerDialog(playerid, 4, DIALOG_STYLE_MSGBOX,"Welcome To BattleField IV","Objectives:\n   PAK: You need to kill your enemy (USA) and place a C4 near Control Center in your enemy base\n   USA: You need to kill your enemy (PAK) and place  C4 near AirForces\nCommands:\n   /kill - To kill yourself\n   /ct - To change your class\n   /login - To login to your account\n   /stats [id] - see others stats. you can see your stats too by using only /stats without id\n   /admins - To see online admins\n   /vip - To see online Vips\n   /report - To report player to online admins\n   /changepass [new password] - To change your password","Ok","");
It can be done:
pawn Код:
ShowPlayerDialog(playerid, 4, DIALOG_STYLE_MSGBOX,"Welcome To BattleField IV","Objectives:\n   PAK: You need to kill your enemy (USA) and place a C4 near Control Center in your enemy base\n   \
    USA: You need to kill your enemy (PAK) and place  C4 near AirForces\nCommands:\n   /kill - To kill yourself\n   /ct - To change your class\n   /login - To login to your account\n   \
    /stats [id] - see others stats. you can see your stats too by using only /stats without id\n   /admins - To see online admins\n   /vip - To see online Vips\n   /report - To report player to online admins\n \
      /changepass [new password] - To change your password"
,"Ok","");
Reply
#8

And credits to Dawne too, Ballu just told me about you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)