21.09.2011, 16:42
AKI esta ocorendo varios erros pq
Topico original aki https://sampforum.blast.hk/showthread.php?tid=179513
aki etsao os erros
Topico original aki https://sampforum.blast.hk/showthread.php?tid=179513
PHP код:
/*------------------------------------------------------------------------------
Thanks for downloading the SA-MP Light Control FS by Pghpunkid. Please feel free
to modify as you need. Also, please do not redistribute without my authorization
first. And if you do (with or without my permission) Please leave this header
section. To make this work, simply delete the "//" before "#include" on line 16
then recompile! By doing this, you agree to the above requirements and are going
to follow these few rules of using this free code.
Thanks and enjoy!
-Pghpunkid
------------------------------------------------------------------------------*/
//#include <a_samp>
new LightPwr[MAX_VEHICLES];
new Flasher[MAX_VEHICLES];
new FlasherState[MAX_VEHICLES];
new FlashTimer;
public OnFilterScriptInit()
{
print("\n-----------------------------------");
print(" Light Control FS by Pghpunkid");
print("-----------------------------------\n");
for (new x=0; x<MAX_VEHICLES; x++)
{
LightPwr[x]=1;
Flasher[x]=0;
FlasherState[x]=0;
}
FlashTimer = SetTimer("FlasherFunc",100,1);
return 1;
}
public OnFilterScriptExit()
{
print("\n-----------------------------------");
print(" Light Control FS Unloaded");
print("-----------------------------------\n");
KillTimer(FlashTimer);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256], idx;
cmd = strtok(cmdtext, idx);
new vehicleid,panels,doors,lights,tires;
if (strcmp("/lightsoff", cmd, true) == 0)
{
vehicleid = GetPlayerVehicleID(playerid);
GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
UpdateVehicleDamageStatus(vehicleid, panels, doors, 5, tires);
LightPwr[vehicleid] = 0;
Flasher[vehicleid] = 0;
return 1;
}
if (strcmp("/lightswat", cmd, true) == 0)
{
vehicleid = GetPlayerVehicleID(playerid);
GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
UpdateVehicleDamageStatus(vehicleid, panels, doors, 3, tires);
LightPwr[vehicleid] = 1;
Flasher[vehicleid] = 0;
return 1;
}
if (strcmp("/lightson", cmd, true) == 0)
{
vehicleid = GetPlayerVehicleID(playerid);
GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
UpdateVehicleDamageStatus(vehicleid, panels, doors, 0, tires);
LightPwr[vehicleid] = 1;
Flasher[vehicleid] = 0;
return 1;
}
if (strcmp("/lightsflash", cmd, true) == 0)
{
vehicleid = GetPlayerVehicleID(playerid);
GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
Flasher[vehicleid] = 1;
return 1;
}
if (strcmp("/lightsflashoff", cmd, true) == 0)
{
vehicleid = GetPlayerVehicleID(playerid);
GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
if (LightPwr[vehicleid] == 1)
UpdateVehicleDamageStatus(vehicleid, panels, doors, 0, tires);
else
UpdateVehicleDamageStatus(vehicleid, panels, doors, 5, tires);
Flasher[vehicleid] = 0;
return 1;
}
return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if (LightPwr[vehicleid] == 0)
{
new panels,doors,lights,tires;
GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
UpdateVehicleDamageStatus(vehicleid, panels, doors, 5, tires);
}
else
{
new panels,doors,lights,tires;
GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
UpdateVehicleDamageStatus(vehicleid, panels, doors, 0, tires);
}
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
Flasher[vehicleid] = 0;
if (LightPwr[vehicleid] == 0)
{
new panels,doors,lights,tires;
GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
UpdateVehicleDamageStatus(vehicleid, panels, doors, 5, tires);
}
else
{
new panels,doors,lights,tires;
GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
UpdateVehicleDamageStatus(vehicleid, panels, doors, 0, tires);
}
return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
if (LightPwr[vehicleid] == 0)
{
new panels,doors,lights,tires;
GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
UpdateVehicleDamageStatus(vehicleid, panels, doors, 5, tires);
}
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
if (LightPwr[vehicleid] == 0)
{
new panels,doors,lights,tires;
GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
UpdateVehicleDamageStatus(vehicleid, panels, doors, 5, tires);
}
return 1;
}
public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}
public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
if (LightPwr[vehicleid] == 0)
{
new panels,doors,lights,tires;
GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires);
UpdateVehicleDamageStatus(vehicleid, panels, doors, 5, tires);
}
return 1;
}
public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}
//Option A
/*
public OnPlayerUpdate(playerid)
{
if (IsPlayerInAnyVehicle(playerid))
{
new id;
id = GetPlayerVehicleID(playerid);
if (Flasher[id] == 1)
{
if (FlasherState[id] == 1)
{
new panels,doors,lights,tires;
GetVehicleDamageStatus(id,panels,doors,lights,tires);
UpdateVehicleDamageStatus(id, panels, doors, 4, tires);
FlasherState[id] = 0;
}
else {
new panels,doors,lights,tires;
GetVehicleDamageStatus(id,panels,doors,lights,tires);
UpdateVehicleDamageStatus(id, panels, doors, 1, tires);
FlasherState[id] = 1;
}
}
}
return 1;
}
*/
//Option B
forward FlasherFunc();
public FlasherFunc() {
for (new p=0; p<MAX_PLAYERS; p++)
{
if (IsPlayerInAnyVehicle(p) && IsPlayerConnected(p) && !IsPlayerNPC(p))
{
new id;
new panelsx,doorsx,lightsx,tiresx;
id = GetPlayerVehicleID(p);
if (Flasher[id] == 1)
{
if (FlasherState[id] == 1)
{
GetVehicleDamageStatus(id,panelsx,doorsx,lightsx,tiresx);
UpdateVehicleDamageStatus(id, panelsx, doorsx, 4, tiresx);
FlasherState[id] = 0;
}
else {
GetVehicleDamageStatus(id,panelsx,doorsx,lightsx,tiresx);
UpdateVehicleDamageStatus(id, panelsx, doorsx, 1, tiresx);
FlasherState[id] = 1;
}
}
}
}
return 1;
}
strtok(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}
stock DelPrint(string1[])
{
strmid(string1, string1, 0, strlen(string1)-1, 255);
//printf("%s", string1);
return 1;
}
aki etsao os erros
PHP код:
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(18) : error 017: undefined symbol "MAX_VEHICLES"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(18) : error 009: invalid array size (negative, zero or out of bounds)
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(19) : error 017: undefined symbol "MAX_VEHICLES"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(19) : error 009: invalid array size (negative, zero or out of bounds)
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(20) : error 017: undefined symbol "MAX_VEHICLES"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(20) : error 009: invalid array size (negative, zero or out of bounds)
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(23) : warning 235: public function lacks forward declaration (symbol "OnFilterScriptInit")
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(25) : error 017: undefined symbol "print"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(26) : error 017: undefined symbol "print"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(27) : error 017: undefined symbol "print"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(28) : error 017: undefined symbol "MAX_VEHICLES"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(31) : warning 217: loose indentation
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(34) : error 017: undefined symbol "SetTimer"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(38) : warning 235: public function lacks forward declaration (symbol "OnFilterScriptExit")
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(40) : error 017: undefined symbol "print"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(41) : error 017: undefined symbol "print"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(42) : error 017: undefined symbol "print"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(43) : error 017: undefined symbol "KillTimer"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(47) : warning 235: public function lacks forward declaration (symbol "OnPlayerCommandText")
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(52) : error 017: undefined symbol "strcmp"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(54) : error 017: undefined symbol "GetPlayerVehicleID"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(55) : error 017: undefined symbol "GetVehicleDamageStatus"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(56) : error 017: undefined symbol "UpdateVehicleDamageStatus"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(61) : error 017: undefined symbol "strcmp"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(63) : error 017: undefined symbol "GetPlayerVehicleID"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(64) : error 017: undefined symbol "GetVehicleDamageStatus"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(65) : error 017: undefined symbol "UpdateVehicleDamageStatus"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(70) : error 017: undefined symbol "strcmp"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(72) : error 017: undefined symbol "GetPlayerVehicleID"
C:\Documents and Settings\LUIZ GUSTAVO\Meus documentos\Downloads\lights.pwn(73) : error 017: undefined symbol "GetVehicleDamageStatus"
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
26 Errors.