Get error with script - 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: Get error with script (
/showthread.php?tid=548179)
Get error with script -
hichay - 28.11.2014
Код:
./includes/callbacks.pwn(88) : error 017: undefined symbol "string"
./includes/callbacks.pwn(88) : error 017: undefined symbol "string"
./includes/callbacks.pwn(88) : error 029: invalid expression, assumed zero
./includes/callbacks.pwn(88) : fatal error 107: too many error messages on one line
Here is problem
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(PRESSED(KEY_NO))
{
if(IsPlayerInAnyVehicle(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new engine,lights,alarm,doors,bonnet,boot,objective,vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 510 || DynVeh[vehicleid] != -1 && DynVehicleInfo[DynVeh[vehicleid]][gv_iType] == 1 && GetVehicleModel(vehicleid) == 592) return SendClientMessageEx(playerid,COLOR_WHITE,"This command can't use in this vehicle.");
GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
if(engine == VEHICLE_PARAMS_ON)
{
SetVehicleEngine(vehicleid, playerid);
format(string, sizeof(string), "{FF8000}** {C2A2DA}%s turns the key in the ignition and the engine stops.", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
}
return 1;
}
And here is my code... i don't know what is wrong
Re: Get error with script -
PowerPC603 - 28.11.2014
Look at your other topic, I posted the most easy solution for starting your engine with a keypress.
Or, if you wanna keep the code you posted here, add this at the start of your callback (above "if(PRESSED(KEY_NO))"):
The error-message told you already you didn't have "string" defined.
Or add it here:
pawn Код:
new engine,lights,alarm,doors,bonnet,boot,objective,vehicleid, string[128];