[HELP]Error code
#1

There's one error that is bugging it and i can't finish it
Here's the code:
Код:
	public OnPlayerExitVehicle(playerid, as[0]);
	{
  if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER, as[0])
	{
			if(Attackmod[playerid] == 1)
		{
			RemoveVehicleComponent(GetPlayerVehicleID(playerid),1010); // Removes Nitro
 			RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1087); // Removes Hydraulics
 			RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1001); // Removes Spoiler
  		    RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1074); // Removes Mega Wheels
   		    RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1007); // Removes RSS
   		    RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1017); // Removes LSS
			SendClientMessage(playerid,COLOR_LIGHTRED,"Transformation Offline");
			Attackmod[playerid] = 0;
		}
			return 1;
  }
	if(Tcspawned[playerid] = as)
	{
  		tc[0] = GetPlayerVehicleID(playerid);
  		Tcspawned[playerid] = 0;
   		SendClientMessage(playerid,red,"Tc Removed");
     	DestroyVehicle(tc[0]);
	}
	return 1;
	 }
}
And it gives me this Error when i compile it
Error:
Код:
C:\Users\zzz\Desktop\z\filterscripts\w.pwn(166) : error 029: invalid expression, assumed zero
C:\Users\zzz\Desktop\z\filterscripts\w.pwn(183) : warning 211: possibly unintended assignment
C:\Users\zzz\Desktop\z\filterscripts\w.pwn(369) : warning 203: symbol is never used: "strtok"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
And i can't fix it i need some help
Reply
#2

You must define "strtok".

Read here to fix it:
https://sampwiki.blast.hk/wiki/Strtok

To fix it put that under your script:

Quote:

strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}

new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}

Reply
#3

Btw sorry.... i made a lil change in it before i posted it sorry...

Heres: the new one

Код:
	public OnPlayerExitVehicle(playerid, tc[0]);
	{
  if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER, tc[0])
	{
			if(Attackmod[playerid] == 1)
		{
			RemoveVehicleComponent(GetPlayerVehicleID(playerid),1010); // Removes Nitro
 			RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1087); // Removes Hydraulics
 			RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1001); // Removes Spoiler
  		RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1074); // Removes Mega Wheels
   		RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1007); // Removes RSS
   		RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1017); // Removes LSS
			SendClientMessage(playerid,COLOR_LIGHTRED,"Transformation Offline");
			Attackmod[playerid] = 0;
		}
			return 1;
  }
	if(Tcspawned[playerid] = 1)
	{
  		tc[0] = GetPlayerVehicleID(playerid);
  		Tcspawned[playerid] = 0;
   		SendClientMessage(playerid,red,"Tc Removed");
     	DestroyVehicle(tc[0]);
	}
	return 1;
	 }
}
Reply
#4

Same errors/warnings?
Reply
#5

Quote:

if(Tcspawned[playerid] = 1)

should be
Quote:

if(Tcspawned[playerid] == 1)

Reply
#6

Actually i changed it becuz i hate people stealing my idea.....
its actually quite good
and yes the error is same.. or do you want me to post the full script?
Reply
#7

Quote:
Originally Posted by » RyDeR «
Quote:

if(Tcspawned[playerid] = 1)

should be
Quote:

if(Tcspawned[playerid] == 1)

Ohh thanks it worked
Reply
#8

The last error
pwn(167) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
whichi is one the
Public OnPlayerExitVehicle(playerid, vehicleid)
Reply
#9

Quote:
Originally Posted by [MY
Bryan_3295 ]
The last error
pwn(167) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
whichi is one the
Public OnPlayerExitVehicle(playerid, vehicleid)
Public OnPlayerExitVehicle(playerid, vehicleid);

Becomes


Public OnPlayerExitVehicle(playerid, vehicleid)

Without the ';'
Reply
#10

wait sorry i forgot mine is:

[tabbed here]public onplayerexitvehicle(playerid, tc[0]); thats the error
here... just the error 029

tc[0]: is a car name
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)