Need Help
#1

Hello all! Can anyone look my script and fix this errors:

Код:
//top
new timer1;

//middle
public OnPlayerEnterCheckpoint(playerid)
{
 	new playervehicleid = GetPlayerVehicleID(playerid);

 	if(gObjectiveReached) return;
	if(playervehicleid == OBJECTIVE_VEHICLE_FIREMAN && gTeam[playerid] == TEAM_FIREMAN)
		{  // Green OBJECTIVE REACHED.
	  gObjectiveReached = 1;
	  SendClientMessageToAll (COLOR_ORANGE, "Server: Drugs are on Hospital checkpoint and they need 10 seconds to export!");
   	timer1 = SetTimer("Export", 10000, false);
	}
}
Код:
public OnVehicleDeath(vehicleid, killerid)
{
	new string[256]; new killername[MAX_PLAYER_NAME];
	GetPlayerName (killerid, killername, sizeof(killername));
  new playervehicleid = GetPlayerVehicleID(vehicleid);
  if(playervehicleid == OBJECTIVE_VEHICLE_FIREMAN)
  {//Objective Vehicle Explode
  format(string, sizeof(string), "Server: FireTruck was destroyed by %s (%d).", killername, killerid);
  GameTextForAll ("~y~FireTruck~w~ With Drugs Exploded!", 2000, 5);
  KillTimer("timer1");
	}
}
I have following errors:

Quote:

I:\Mini Missions X\gamemodes\FireMansAtAction.pwn(246) : error 035: argument type mismatch (argument 1)
I:\Mini Missions X\gamemodes\FireMansAtAction.pwn(19 : warning 204: symbol is assigned a value that is never used: "timer1"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

Can you help me to fix it?
Thanks!
Reply
#2

Quote:
Originally Posted by Ironboy500
Код:
//top
new timer1;

//middle
public OnPlayerEnterCheckpoint(playerid)
{
 	new playervehicleid = GetPlayerVehicleID(playerid);

 	if(gObjectiveReached) return;
	if(playervehicleid == OBJECTIVE_VEHICLE_FIREMAN && gTeam[playerid] == TEAM_FIREMAN)
		{ // Green OBJECTIVE REACHED.
	  gObjectiveReached = 1;
	  SendClientMessageToAll (COLOR_ORANGE, "Server: Drugs are on Hospital checkpoint and they need 10 seconds to export!");
  	timer1 = SetTimer("Export", 10000, false);
	}
}
Try this:

Код:
//middle
public OnPlayerEnterCheckpoint(playerid)
{
 	new playervehicleid = GetPlayerVehicleID(playerid);
     new timer1;

 	if(gObjectiveReached) return;
	if(playervehicleid == OBJECTIVE_VEHICLE_FIREMAN && gTeam[playerid] == TEAM_FIREMAN)
		{  // Green OBJECTIVE REACHED.
	  gObjectiveReached = 1;
	  SendClientMessageToAll (COLOR_ORANGE, "Server: Drugs are on Hospital checkpoint and they need 10 seconds to export!");
   	timer1 = SetTimer("Export", 10000, false);
	}
}
Reply
#3

Still same 2 errors:

Quote:

I:\Mini Missions X\gamemodes\FireMansAtAction.pwn(197) : warning 204: symbol is assigned a value that is never used: "timer1"
I:\Mini Missions X\gamemodes\FireMansAtAction.pwn(245) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

Reply
#4

Anymore help?
Reply
#5

Quote:
Originally Posted by Ironboy500
Still same 2 errors:

Quote:

I:\Mini Missions X\gamemodes\FireMansAtAction.pwn(197) : warning 204: symbol is assigned a value that is never used: "timer1"
I:\Mini Missions X\gamemodes\FireMansAtAction.pwn(245) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

thats only 1 error, the first is a warning, which means that you store something in the variable timer1 but never recall the variable
and the error itself means that you entered the wrong kind or argument, KillTimer wants an id not a string

To fix the warning and the error just delete the two quotation marks in KillTimer (second last line of OnVehicleDeath)
Reply
#6

Thanks dude
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)