PDA

View Full Version : [HELP] Filescript Compiling errors [+REP]


EgyptForLife
25/07/2014, 05:41 PM
Hello,

I was compiling my filescripts, and I got these errors :

C:\Users\User\Desktop\DC\filterscripts\arjanzadmin .pwn(275) : error 021: symbol already defined: "strtok"
C:\Users\User\Desktop\DC\filterscripts\arjanzadmin .pwn(290) : error 047: array sizes do not match, or destination array is too small
C:\Users\User\Desktop\DC\filterscripts\arjanzadmin .pwn(2151) : error 047: array sizes do not match, or destination array is too small
C:\Users\User\Desktop\DC\filterscripts\arjanzadmin .pwn(2202) : error 047: array sizes do not match, or destination array is too small
C:\Users\User\Desktop\DC\filterscripts\arjanzadmin .pwn(2251) : error 047: array sizes do not match, or destination array is too small
C:\Users\User\Desktop\DC\filterscripts\arjanzadmin .pwn(2402) : error 047: array sizes do not match, or destination array is too small
C:\Users\User\Desktop\DC\filterscripts\arjanzadmin .pwn(2404) : error 047: array sizes do not match, or destination array is too small
C:\Users\User\Desktop\DC\filterscripts\arjanzadmin .pwn(2438) : error 047: array sizes do not match, or destination array is too small
C:\Users\User\Desktop\DC\filterscripts\arjanzadmin .pwn(2440) : error 047: array sizes do not match, or destination array is too small
C:\Users\User\Desktop\DC\filterscripts\arjanzadmin .pwn(2474) : error 047: array sizes do not match, or destination array is too small
C:\Users\User\Desktop\DC\filterscripts\arjanzadmin .pwn(2504) : error 047: array sizes do not match, or destination array is too small
C:\Users\User\Desktop\DC\filterscripts\arjanzadmin .pwn(2508) : error 047: array sizes do not match, or destination array is too small
C:\Users\User\Desktop\DC\filterscripts\arjanzadmin .pwn(2539) : error 047: array sizes do not match, or destination array is too small
C:\Users\User\Desktop\DC\filterscripts\arjanzadmin .pwn(2592) : error 047: array sizes do not match, or destination array is too small
C:\Users\User\Desktop\DC\filterscripts\arjanzadmin .pwn(2782) : error 047: array sizes do not match, or destination array is too small
C:\Users\User\Desktop\DC\filterscripts\arjanzadmin .pwn(3760) : error 047: array sizes do not match, or destination array is too small
C:\Users\User\Desktop\DC\filterscripts\arjanzadmin .pwn(3777) : error 047: array sizes do not match, or destination array is too small
C:\Users\User\Desktop\DC\filterscripts\arjanzadmin .pwn(3852) : error 047: array sizes do not match, or destination array is too small
C:\Users\User\Desktop\DC\filterscripts\arjanzadmin .pwn(4041) : warning 219: local variable "Time" shadows a variable at a preceding level
C:\Users\User\Desktop\DC\filterscripts\arjanzadmin .pwn(4076) : warning 219: local variable "Time" shadows a variable at a preceding level
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


18 Errors.


Here are the lines of the errors :
Line #270 - #280

end:
return playername;
}

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


Lines #285 - #300 :

{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}

IsNumeric(const string[])
{
for (new i = 0, j = strlen(string); i < j; i++)
{
if (string[i] > '9' || string[i] < '0') return 0;
}
return 1;
}

Lines #2150 - #2160 :

new tmp[128];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_ORANGE, VhFix_PlNOV);

RepairVehicle(GetPlayerVehicleID(playerid));
SetVehicleHealth(GetPlayerVehicleID(playerid), 1000);

new Message1[144] = "[DC]Admin -|{FFFFFF} Admin{CECECE} %s {8000FF}has fixed his vehicle |-";
format(Message1, sizeof(Message1), Message1, GetName(playerid));

Lines #2199 - #2210 :

if(PlayerVal[playerid][VLvlAdmin] >= 4)
{
new tmp[128]; new PID;
tmp = strtok(cmdtext, idx);

if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_ORANGE, AGoto_Usage);
PID = strval(tmp); format(AGoto_IDNOC, sizeof(AGoto_IDNOC), AGoto_IDNOC, PID);
if(!IsPlayerConnected(PID)) return SendClientMessage(playerid, COLOR_ORANGE, AGoto_IDNOC);

new Float:X, Float:Y, Float:Z, VW, intr;
format(AGoto_Messg, sizeof(AGoto_Messg), AGoto_Messg, GetName(playerid), GetName(PID,1));


Lines #2250 - #2260 :

new tmp[128]; new PID;
tmp = strtok(cmdtext, idx);

if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_ORANGE, GHere_Usage);
PID = strval(tmp); format(GHere_IDNOC, sizeof(GHere_IDNOC), GHere_IDNOC, PID);
if(!IsPlayerConnected(PID)) return SendClientMessage(playerid, COLOR_ORANGE, GHere_IDNOC);


if(PlayerVal[PID][VDuty] == 1)
{
new Dutty_Mode[144] = "[Error] -|{FFFFFF} The player with id -|{33CCFF} %i {FFFFFF}|- is {FF0000}using Duty Mode |-";

Lines #2400 - #2410 :

if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, CCLOR_NoCar);

tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_ORANGE, CCLOR_Usage);
COLOR1 = strval(tmp); tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_ORANGE, CCLOR_Usage);
COLOR2 = strval(tmp);

if(COLOR1 < 0 || COLOR1 > 255) return SendClientMessage(playerid, COLOR_ORANGE, CCLOR_Usage);
if(COLOR2 < 0 || COLOR2 > 255) return SendClientMessage(playerid, COLOR_ORANGE, CCLOR_Usage);


Lines #2435 - #2450


if(PlayerVal[playerid][VLvlAdmin] < 2) return SendClientMessage(playerid, COLOR_ORANGE, STime_NOAdm);

tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_ORANGE, STime_Usage);
hour = strval(tmp); tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_ORANGE, STime_Usage);
minute = strval(tmp);

if(hour < 0 || hour > 23) return SendClientMessage(playerid, COLOR_ORANGE, STime_NHour);
if(minute < 0 || minute > 59) return SendClientMessage(playerid, COLOR_ORANGE, STime_NMint);

CallRemoteFunction("SetTime","i/i", hour, minute);

new HourS[4], MinuteS[4];


Lines #2470 - #2480 :

new tmp[128]; new WeatherID;

if(PlayerVal[playerid][VLvlAdmin] < 1) return SendClientMessage(playerid, COLOR_ORANGE, SWeat_NOAdm);

tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_ORANGE, SWeat_Usage);
WeatherID = strval(tmp);

if(WeatherID < 0 || WeatherID > 700) return SendClientMessage(playerid, COLOR_ORANGE, SWeat_NWeat);

SetWeather(WeatherID);

Lines #2500 - #2510 :

new tmp[128]; new WeatherID, PPlayerID;

if(PlayerVal[playerid][VLvlAdmin] < 1) return SendClientMessage(playerid, COLOR_ORANGE, SWeat_NOAdm);

tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_ORANGE, SWeat_Usage);
PPlayerID = strval(tmp);

tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_ORANGE, SWeat_Usage);
WeatherID = strval(tmp);

Lines #2530 - #2540 :

new Freez_NOAdm[128] = "[DC|CMD] -|{FFFFFF} Your admin level must be 2 or higher {F6F600}|-";
new Freez_IDNOC[128] = "[DC|CMD] -|{FFFFFF} The player with id -|{33CCFF} %i {FFFFFF}|- is {F60000}not connected {FF9900}|-";

new Freez_plyer[144] = "[DC]Admin -|{FFFFFF} Admin{CECECE} %s{FFFFFF} has freezed {5CB5F5}%s {53FFFF}|-";

new tmp[128]; new PTFreez;

if(PlayerVal[playerid][VLvlAdmin] < 2) return SendClientMessage(playerid, COLOR_ORANGE, Freez_NOAdm);

tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_ORANGE, Freez_Usage);

Lines #2590 - #2600 :

if(PlayerVal[playerid][VLvlAdmin] < 2) return SendClientMessage(playerid, COLOR_ORANGE, Freez_NOAdm);

tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_ORANGE, Freez_Usage);
PTFreez = strval(tmp);

format(Freez_IDNOC, sizeof(Freez_IDNOC), Freez_IDNOC, PTFreez);
if(!IsPlayerConnected(PTFreez)) return SendClientMessage(playerid, COLOR_ORANGE, Freez_IDNOC);

if(!PlayerVal[PTFreez][VFreeze])
{

Lines #2780 - #2790 :

if(PlayerVal[playerid][VLvlAdmin] < 2) return SendClientMessage(playerid, COLOR_ORANGE, PSlap_NOAdm);

tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_ORANGE, PSlap_Usage);
PTSlap = strval(tmp);

format(PSlap_IDNOC, sizeof(PSlap_IDNOC), PSlap_IDNOC, PTSlap);
format(PSlap_IDFRZ, sizeof(PSlap_IDFRZ), PSlap_IDFRZ, GetName(playerid, 1));
format(PSlap_IDSPD, sizeof(PSlap_IDSPD), PSlap_IDSPD, GetName(playerid, 1));

if(!IsPlayerConnected(PTSlap)) return SendClientMessage(playerid, COLOR_ORANGE, PSlap_IDNOC);

Lines #3755 - #3566 :




if (strcmp(cmd, "/int", true) == 0)
{
new tmp[24]; tmp = strtok(cmdtext, idx);
new INT = strval(tmp);

SetPlayerInterior(playerid, INT);

return 1;
}

Lines #3770 - #3780 :

{
new SpawnFile[128] = "/[DC]Admin/points.spn";
new Entry[256] = "%s : %f, %f, %f, %f\n";

new Float:X, Float:Y, Float:Z;
new Float:P;

new Strg[50]; Strg = strtok(cmdtext, idx);

GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, P);

Lines #3850 - #3860 :

new Bvar;

var = strtok(cmdtext, idx);

if(!strlen(var)) return SendClientMessage(playerid, 0xFF9900FF,USAGE);
Bvar = strval(var);

if(Bvar != 0 && Bvar != 1) return SendClientMessage(playerid, 0xFF9900FF,USAGE);

if(Bvar == 0)
{

Lines #4040 - #4050 :

new Date[32] = "%02d/%02d/%02d", Day , Mounth, Year ;
new Time[32] = "%02d:%02d:%02d", Hour, Minute, Second ;


getdate(Year, Mounth, Day),
gettime(Hour, Minute, Second);

format(Date, sizeof(Date), Date, Day , Mounth, Year );
format(Time, sizeof(Time), Time, Hour, Minute, Second );

new Entry[1024] = "From: %s | [%s][%s] | %s\n";

Lines #4070 - #4080 :

new tmp[512]; tmp = strtok(cmdtext, idx);

if(!strlen(tmp)) return SendClientMessage(playerid, 0xFF9900FF, Usage);

strdel(cmdtext, 0, 9);
new Date[32] = "%02d/%02d/%02d", Day , Mounth, Year ;
new Time[32] = "%02d:%02d:%02d", Hour, Minute, Second;

getdate(Year, Mounth, Day),
gettime(Hour, Minute, Second);



Who will help me at least with one thing and it works = +REP

Affan
25/07/2014, 06:13 PM
For this error:
error 021: symbol already defined: "strtok"

Just find the strtok and delete it, since it's already defined.

EgyptForLife
25/07/2014, 06:18 PM
For this error:
error 021: symbol already defined: "strtok"

Just find the strtok and delete it, since it's already defined.
After what you told me, 16 errors now :

C:\Users\User\Desktop\DC\filterscripts\arjanzadmin .pwn(2132) : error 047: array sizes do not match, or destination array is too small
C:\Users\User\Desktop\DC\filterscripts\arjanzadmin .pwn(2183) : error 047: array sizes do not match, or destination array is too small
C:\Users\User\Desktop\DC\filterscripts\arjanzadmin .pwn(2232) : error 047: array sizes do not match, or destination array is too small
C:\Users\User\Desktop\DC\filterscripts\arjanzadmin .pwn(2383) : error 047: array sizes do not match, or destination array is too small
C:\Users\User\Desktop\DC\filterscripts\arjanzadmin .pwn(2385) : error 047: array sizes do not match, or destination array is too small
C:\Users\User\Desktop\DC\filterscripts\arjanzadmin .pwn(2419) : error 047: array sizes do not match, or destination array is too small
C:\Users\User\Desktop\DC\filterscripts\arjanzadmin .pwn(2421) : error 047: array sizes do not match, or destination array is too small
C:\Users\User\Desktop\DC\filterscripts\arjanzadmin .pwn(2455) : error 047: array sizes do not match, or destination array is too small
C:\Users\User\Desktop\DC\filterscripts\arjanzadmin .pwn(2485) : error 047: array sizes do not match, or destination array is too small
C:\Users\User\Desktop\DC\filterscripts\arjanzadmin .pwn(2489) : error 047: array sizes do not match, or destination array is too small
C:\Users\User\Desktop\DC\filterscripts\arjanzadmin .pwn(2520) : error 047: array sizes do not match, or destination array is too small
C:\Users\User\Desktop\DC\filterscripts\arjanzadmin .pwn(2573) : error 047: array sizes do not match, or destination array is too small
C:\Users\User\Desktop\DC\filterscripts\arjanzadmin .pwn(2763) : error 047: array sizes do not match, or destination array is too small
C:\Users\User\Desktop\DC\filterscripts\arjanzadmin .pwn(3741) : error 047: array sizes do not match, or destination array is too small
C:\Users\User\Desktop\DC\filterscripts\arjanzadmin .pwn(3758) : error 047: array sizes do not match, or destination array is too small
C:\Users\User\Desktop\DC\filterscripts\arjanzadmin .pwn(3833) : error 047: array sizes do not match, or destination array is too small
C:\Users\User\Desktop\DC\filterscripts\arjanzadmin .pwn(4022) : warning 219: local variable "Time" shadows a variable at a preceding level
C:\Users\User\Desktop\DC\filterscripts\arjanzadmin .pwn(4057) : warning 219: local variable "Time" shadows a variable at a preceding level
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


16 Errors.



+REP For you.

Affan
25/07/2014, 06:22 PM
I suggest you to use sscanf, it's WAY easier than this!

EgyptForLife
25/07/2014, 06:31 PM
I suggest you to use sscanf, it's WAY easier than this!

This [FILESCRIPT] is almost 1/2 my [Gamemode] , it include all my commands and client messages. I can't delete it.

EgyptForLife
26/07/2014, 02:15 PM
**BUMB**
I still need help.

Guest4390857394857
26/07/2014, 04:53 PM
Use sscanf and zcmd!
You are using an outdated scheme!

EgyptForLife
26/07/2014, 05:26 PM
Use sscanf and zcmd!
You are using an outdated scheme!

I am using sscanf2 plugin. But i can't remove this filescript, as i said it contains almost 1/2 my gamemode.

EgyptForLife
27/07/2014, 01:56 AM
**BUMB**
I still need help

EgyptForLife
27/07/2014, 04:02 PM
**BUMP**