29.05.2014, 05:00
(
Последний раз редактировалось Team_PRO; 29.05.2014 в 06:43.
)
EDIT: Fixed
SetupSpeedCamera(CamID, Float:x, Float:y, Float:z, Float:rot, MaxSpeed)
SetupSpeedCamera(CamID, Float:x, Float:y, Float:z, Float:rot, MaxSpeed);
|
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. |
// 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);
}
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.
// Decrease the remaining time this player will be frozen
APlayerData[playerid][PlayerFrozen]--;
// 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]);
}
}
|
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]);
}
}
|