wrong code?
#1

What's wrong with this respawn car code?


Код:
	   if(!strcmp(cmdtext, "/rc", true))
    {
        for(new i = 0; i < MAX_VEHICLES; i++)
        {
         if (adminlevel[playerid] >= 5)
    	{
         SetVehicleToRespawn(i);
         new str[100];
  	     format(str,sizeof str,"0,13%s respawned all cars.",(sendername));
   	   	 IRC_GroupSay(IRC_Group, EchoChan,str);
        }
		}
		else
		SendClientMessage(playerid, RED, "You cannot use this command!");
		return 1;
	}
I got this error

Код:
C:\Documents and Settings\k\Desktop\COD5.pwn(7166) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#2

It's because you have an else statement but there is no matching if statement!

Also please indent code for the love of god

pawn Код:
if(!strcmp(cmdtext, "/rc", true))
{
    for(new i = 0; i < MAX_VEHICLES; i++)
    {
        if (adminlevel[playerid] >= 5)
        {
            SetVehicleToRespawn(i);
            new str[100];
            format(str,sizeof str,"0,13%s respawned all cars.",sendername);
            IRC_GroupSay(IRC_Group, EchoChan,str);
        }
        else SendClientMessage(playerid, RED, "You cannot use this command!");
    }
    return 1;
}
I believe that's what you intended
Reply
#3

Yeah,now it's working,thanks!

P.S. Yeah the ident is fucked up lol
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)