Invalid expression assumed zero
#1

Hi, I try to make an killerstreak.. but i still get an error..

My pawn code:
Код:
new name1[MAX_PLAYER_NAME+1] = GetPlayerName(killerid, name1, sizeof(name1));
switch(killstreak[killerid])
     {
		  case 1:
		  {
			   SendClientMessage(killerid, -1,"Your now on Killstreak of 1!");
          }
          case 5:
          {
               SendClientMessage(killerid, -1,"Your now on Killstreak of 5!!");
               forward(string, sizeof(string), "NEW KILLER %s has killed 5 suspects!, stop him and KILL him!", name1);
               SendClientMessageToAll(COLOR_RED, string);
          }
          case 10:
          {
               SendClientMessage(killerid, -1,"Your now on Killstreak of 10!!");
               forward(string, sizeof(string), "POWER KILLER %s has killed 10 suspects!, stop him and KILL him!", name1);
               SendClientMessageToAll(COLOR_RED, string);
          }
          case 15:
          {
               SendClientMessage(killerid, -1,"Your now on Killstreak of 15!!");
               forward(string, sizeof(string), "HARDCORE KILLER %s has killed 15 suspects!, stop him and KILL him!", name1);
               SendClientMessageToAll(COLOR_RED, string);
          }
          case 20:
          {
               SendClientMessage(killerid, -1,"Your now on Killstreak of 20!!");
               forward(string, sizeof(string), "MONSTER KILLER %s has killed 20 suspects!, stop him and KILL him!", name1);
               SendClientMessageToAll(COLOR_RED, string);
          }
          case 30:
          {
               SendClientMessage(killerid, -1,"Your now on Killstreak of  30!!");
               forward(string, sizeof(string), "UBER KILLER %s has killed 30 suspects!, stop him and KILL him!", name1);
               SendClientMessageToAll(COLOR_RED, string);
          }
          case 50:
          {
               SendClientMessage(killerid, -1,"Your now on Killstreak of  50!!");
               forward(string, sizeof(string), "ULTIMATE MASTER KILLER %s has killed 50 suspects!, stop him and KILL him!", name1);
               SendClientMessageToAll(COLOR_RED, string);
          }
     }
The error:

The problem comes from the forward lines.
Reply
#2

Try this:
pawn Код:
new name1[MAX_PLAYER_NAME+1];
GetPlayerName(killerid, name1, sizeof(name1));
Anyway, what OS do you have there?
Reply
#3

Change every single line of:
pawn Код:
forward(string, sizeof(string)
to:
pawn Код:
format(string, sizeof(string)
and also change:
pawn Код:
new name1[MAX_PLAYER_NAME+1] = GetPlayerName(killerid, name1, sizeof(name1));
to:
pawn Код:
new name1[MAX_PLAYER_NAME];
GetPlayerName(killerid, name1, sizeof(name1));
Reply
#4

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Change every single line of:
pawn Код:
forward(string, sizeof(string)
to:
pawn Код:
format(string, sizeof(string)
and also change:
pawn Код:
new name1[MAX_PLAYER_NAME+1] = GetPlayerName(killerid, name1, sizeof(name1));
to:
pawn Код:
new name1[MAX_PLAYER_NAME];
GetPlayerName(killerid, name1, sizeof(name1));
Thanks it worked #rep
Reply
#5

Quote:
Originally Posted by ACI
Посмотреть сообщение
Try this:
pawn Код:
new name1[MAX_PLAYER_NAME+1];
GetPlayerName(killerid, name1, sizeof(name1));
Anyway, what OS do you have there?
I bougt an old school computer, upgrated the HD and RAM and installed Windows Server 2008 R1 Standard .
So what you see is my tiny Development Server.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)