#define CAMERA_PATH "/Cameras/%d.ini" #define MAX_CAMERAS 100 enum cInfo { cax, cay, caz, limit, cangle } new CameraInfo[MAX_CAMERAS][cInfo]; stock CameraPath() { new string[128],cameraid = CameraCount; //line 1438 format(string,sizeof(string),CAMERA_PATH, cameraid); return string; } CMD:createcamera(playerid,params[]) { if(PlayerInfo[playerid][pLevel] < 3) return error if (sscanf(params,"n",limit)) return SendClientMessage(playerid, COLOR_RED,"USAGE: /createcamera <speedlimit>"); new Float:x,Float:y,Float:z,Float:cangle; GetPlayerPos(playerid,x,y,z); //line 1447 z = z - 1.0; GetPlayerFacingAngle(playerid,cangle); new INI:File = INI_Open(CameraPath()); //line 1450 INI_SetTag(File, "Main"); INI_WriteInt(File, "Limit", limit); INI_WriteFloat(File, "X", x); INI_WriteFloat(File, "Y", y); INI_WriteFloat(File, "Z", z); INI_WriteFloat(File, "Angle", cangle); INI_Close(File); Camera[cameraid] = CreateDynamicObject(18880, x, y, z, 0.0, 0.0, cangle); //line 1458 SendClientMessage(playerid, COLOR_LIMEGREEN,"Speedcamera created!"); return 1; }
C:\Users\Dorian\Desktop\sa-mp\gamemodes\bhaulers.pwn(1438) : error 017: undefined symbol "CameraCount" C:\Users\Dorian\Desktop\sa-mp\gamemodes\bhaulers.pwn(1458) : error 017: undefined symbol "Camera" C:\Users\Dorian\Desktop\sa-mp\gamemodes\bhaulers.pwn(1458) : error 017: undefined symbol "cameraid" C:\Users\Dorian\Desktop\sa-mp\gamemodes\bhaulers.pwn(1458) : error 029: invalid expression, assumed zero C:\Users\Dorian\Desktop\sa-mp\gamemodes\bhaulers.pwn(1458) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 5 Errors.
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#include <YSI\y_ini>
#define CAMERA_PATH "/Cameras/%d.ini"
#define MAX_CAMERAS 100
#define error SendClientMessage(playerid, COLOR_RED, "You don't have permission to use this command!");
new cameracount=0;
stock CameraPath()
{
new string[128],cameraid = cameracount; //line 1438
format(string,sizeof(string),CAMERA_PATH, cameraid);
return string;
}
CMD:createcamera(playerid,params[])
{
if(cameracount<MAX_CAMERAS)
{
if(!IsPlayerAdmin(playerid)) return 0; //your own level checks here!
new limit;
if (sscanf(params,"n",limit)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /createcamera <speedlimit>");
new Float:x,Float:y,Float:z,Float:cangle;
GetPlayerPos(playerid,x,y,z); //line 1447
z = z - 1.0;
GetPlayerFacingAngle(playerid,cangle);
new INI:File = INI_Open(CameraPath()); //line 1450
INI_SetTag(File, "Main");
INI_WriteInt(File, "Limit", limit);
INI_WriteFloat(File, "X", x);
INI_WriteFloat(File, "Y", y);
INI_WriteFloat(File, "Z", z);
INI_WriteFloat(File, "Angle", cangle);
INI_Close(File);
new Camera = CreateObject(18880, x, y, z, 0.0, 0.0, cangle); //line 1458
SendClientMessage(playerid,COLOR_LIMEGREEN,"Speedcamera created!");
cameracount++;
}
return 1;
}
Need a Semi-colon here?
pawn Код:
|
#define error SendClientMessage(playerid, COLOR_RED, "You don't have permission to use this command!");
i'm sorry if i'm wrong i'm trying to help
define this #define CameraCount #define Camera #define Cameraid |
pawn Код:
|
C:\Users\Dorian\Desktop\sa-mp\gamemodes\bhaulers.pwn(1465) : warning 204: symbol is assigned a value that is never used: "Camera" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Warning.
#include <a_samp>
#include <sscanf2>
#include <zcmd>
#include <YSI\y_ini>
#include <streamer>
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
LoadCameras();
return 1;
}
#else
public OnGameModeInit()
{
LoadCameras();
return 1;
}
#endif
#define CAMERA_PATH "/Cameras/%d.ini"
#define MAX_CAMERAS 100
enum cInfo
{
Float:cax,
Float:cay,
Float:caz,
limit,
Float:cangle
}
new CameraInfo[MAX_CAMERAS][cInfo];
new Camera[MAX_CAMERAS];
stock CameraPath(cameraid)
{
new string[40];
format(string,sizeof(string), CAMERA_PATH, cameraid);
return string;
}
CMD:createcamera(playerid,params[])
{
if(PlayerInfo[playerid][pLevel] < 3) return SendClientMessage(playerid, COLOR_RED, "You must be a level 3+ Administrator to use this command!");
new slimit;
if(sscanf(params,"i",slimit)) return SendClientMessage(playerid, COLOR_RED,"USAGE: /createcamera <speedlimit>");
new Float:x,Float:y,Float:z,Float:pangle;
GetPlayerPos(playerid,x,y,z); //line 1447
z -= 1.0;
GetPlayerFacingAngle(playerid,pangle);
new nextid = GetNextCameraID();
if(nextid == -1) return SendClientMessage(playerid, COLOR_RED, "You have reached the maximum amount of speed cameras, please delete one before continuing.");
new INI:File = INI_Open(CameraPath(nextid)); //line 1450
INI_SetTag(File, "Main");
INI_WriteInt(File, "Limit", slimit);
INI_WriteFloat(File, "X", x);
INI_WriteFloat(File, "Y", y);
INI_WriteFloat(File, "Z", z);
INI_WriteFloat(File, "Angle", pangle);
INI_Close(File);
Camera[nextid] = CreateDynamicObject(18880, x, y, z, 0.0, 0.0, pangle); //line 1458
SendClientMessage(playerid, COLOR_LIMEGREEN,"Speedcamera created!");
return 1;
}
stock GetNextCameraID()
{
for(new i = 0; i < MAX_CAMERAS; i++)
{
if(fexist(CameraPath(i))) continue;
return i;
}
return -1;
}
stock LoadCameras()
{
new file[40];
for(new i = 0; i < MAX_CAMERAS; i++)
{
format(file, sizeof(file), CAMERA_PATH, i);
if(fexist(file))
{
INI_ParseFile(file, "LoadCameraData_%s", .bExtra = true, .extra = i);
Camera[i] = CreateDynamicObject(18880, CameraInfo[i][cax], CameraInfo[i][cay], CameraInfo[i][caz], 0.0, 0.0, CameraInfo[i][cangle]);
}
}
return 1;
}
forward LoadCameraData_Main(cameraid, name[], value[]);
public LoadCameraData_Main(cameraid, name[], value[])
{
INI_Int("Limit", CameraInfo[cameraid][limit]);
INI_Float("X", CameraInfo[cameraid][cax]);
INI_Float("Y", CameraInfo[cameraid][cay]);
INI_Float("Z", CameraInfo[cameraid][caz]);
INI_Float("Angle", CameraInfo[cameraid][cangle]);
return 1;
}
Код:
C:\Users\Dorian\Desktop\sa-mp\gamemodes\bhaulers.pwn(1465) : warning 204: symbol is assigned a value that is never used: "Camera" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Warning. |
new Camera=CreateObject
to
CreateObject...