SA-MP Forums Archive
Trucking Error Help Please - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Trucking Error Help Please (/showthread.php?tid=515993)



Trucking Error Help Please - Team_PRO - 29.05.2014

EDIT: Fixed


Re: Trucking Error Help Please - Lynn - 29.05.2014

Change
pawn Код:
SetupSpeedCamera(CamID, Float:x, Float:y, Float:z, Float:rot, MaxSpeed)
To this;
Код:
SetupSpeedCamera(CamID, Float:x, Float:y, Float:z, Float:rot, MaxSpeed);



Re: Trucking Error Help Please - Team_PRO - 29.05.2014

Quote:
Originally Posted by Lynn
Посмотреть сообщение
Change
pawn Код:
SetupSpeedCamera(CamID, Float:x, Float:y, Float:z, Float:rot, MaxSpeed)
To this;
Код:
SetupSpeedCamera(CamID, Float:x, Float:y, Float:z, Float:rot, MaxSpeed);
nothing happens still errors


Re: Trucking Error Help Please - Lynn - 29.05.2014

Post the entire thing in Pastebin.
I can't be bothered to go through that lose indention mess it creates when its posted on here.


Re: Trucking Error Help Please - Team_PRO - 29.05.2014

Quote:
Originally Posted by Lynn
Посмотреть сообщение
Post the entire thing in Pastebin.
I can't be bothered to go through that lose indention mess it creates when its posted on here.
http://pastebin.com/hZjmsGm3


Re: Trucking Error Help Please - ZaBraNjeNi - 29.05.2014

Код:
// This function creates a speedcamera (store data and create the objects)
SetupSpeedCamera(CamID, Float:x, Float:y, Float:z, Float:rot, MaxSpeed)
}
    new TextMaxSpeed[30];

// Store all the given values
    ACameras[CamID][CamX] = x;
    ACameras[CamID][CamY] = y;
    ACameras[CamID][CamZ] = z;
    ACameras[CamID][CamAngle] = rot;
    ACameras[CamID][CamSpeed] = MaxSpeed;
// Create both camera objects and store their reference
    ACameras[CamID][CamObj1] = CreateObject(18880, x, y, z, 0.0, 0.0, rot);
    ACameras[CamID][CamObj2] = CreateObject(18880, x, y, z, 0.0, 0.0, rot + 180.0);
    format(TextMaxSpeed, sizeof(TextMaxSpeed), "%s %i", TXT_MaxSpeedCamera, MaxSpeed);
    ACameras[CamID][LabelID] = Create3DTextLabel(TextMaxSpeed, 0xFF0000FF, x, y, z + 0.75, 100.0, 0, 0);
}



Re: Trucking Error Help Please - Team_PRO - 29.05.2014

new error Line 256 is now Fixed

Код:
C:\Users\Matt\Desktop\Untitled.pwn(169) : error 017: undefined symbol "APlayerData"
C:\Users\Matt\Desktop\Untitled.pwn(169) : warning 215: expression has no effect
C:\Users\Matt\Desktop\Untitled.pwn(169) : error 001: expected token: ";", but found "]"
C:\Users\Matt\Desktop\Untitled.pwn(169) : error 029: invalid expression, assumed zero
C:\Users\Matt\Desktop\Untitled.pwn(169) : fatal error 107: too many error messages on one line

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


4 Errors.
line

pawn Код:
// Decrease the remaining time this player will be frozen
APlayerData[playerid][PlayerFrozen]--;



Re: Trucking Error Help Please - ZaBraNjeNi - 29.05.2014

Compare codes:
Код:
// This timer informs the player how long he will be frozen
forward Player_FreezeTimer(playerid);
public Player_FreezeTimer(playerid)
{
	// Setup local variables
	new Msg[128];

	// Decrease the remaining time this player will be frozen
	APlayerData[playerid][PlayerFrozen]--;

	// Check if the player is allowed to move again
	if (APlayerData[playerid][PlayerFrozen] >= 1)
	{
		// Construct the message to inform the player how long he stays frozen
		if (APlayerData[playerid][PlayerFrozen] >= 60)
			format(Msg, 128, "Frozen for %i minutes", APlayerData[playerid]

[PlayerFrozen] / 60);
		else
			format(Msg, 128, "Frozen for %i seconds", APlayerData[playerid]

[PlayerFrozen]);

		// Display the message to inform the player how long he stays frozen
		GameTextForPlayer(playerid, Msg, 1000, 4);
	}
	else { // The timer has run out, so allow his to move again
		TogglePlayerControllable(playerid, 1);
		KillTimer(FreezeTimer[playerid]);
	}
}



Re: Trucking Error Help Please - Team_PRO - 29.05.2014

Quote:
Originally Posted by ZaBraNjeNi
Посмотреть сообщение
Compare codes:
Код:
// This timer informs the player how long he will be frozen
forward Player_FreezeTimer(playerid);
public Player_FreezeTimer(playerid)
{
	// Setup local variables
	new Msg[128];

	// Decrease the remaining time this player will be frozen
	APlayerData[playerid][PlayerFrozen]--;

	// Check if the player is allowed to move again
	if (APlayerData[playerid][PlayerFrozen] >= 1)
	{
		// Construct the message to inform the player how long he stays frozen
		if (APlayerData[playerid][PlayerFrozen] >= 60)
			format(Msg, 128, "Frozen for %i minutes", APlayerData[playerid]

[PlayerFrozen] / 60);
		else
			format(Msg, 128, "Frozen for %i seconds", APlayerData[playerid]

[PlayerFrozen]);

		// Display the message to inform the player how long he stays frozen
		GameTextForPlayer(playerid, Msg, 1000, 4);
	}
	else { // The timer has run out, so allow his to move again
		TogglePlayerControllable(playerid, 1);
		KillTimer(FreezeTimer[playerid]);
	}
}
nothing still got errors in that line


Re: Trucking Error Help Please - ZaBraNjeNi - 29.05.2014

Download my file, and put in your include's file.
And than re-compile.

http://www.solidfiles.com/d/c9ea57405c/PPC_Common.inc