26.07.2012, 03:39
Am kinda new to scripting so I was trying to fix some errors I had in my script and I need some help to fix them.
Here are the errors:
C:\Users\USER\Desktop\Gamemode.pwn(239) : warning 217: loose indentation
C:\Users\USER\Desktop\Gamemode.pwn(239) : error 029: invalid expression, assumed zero
C:\Users\USER\Desktop\Gamemode.pwn(239) : error 004: function "OnPlayerEnterVehicle" is not implemented
C:\Users\USER\Desktop\Gamemode.pwn(244) : warning 225: unreachable code
C:\Users\USER\Desktop\Gamemode.pwn(244) : error 029: invalid expression, assumed zero
C:\Users\USER\Desktop\Gamemode.pwn(244) : error 004: function "OnPlayerKeyStateChange" is not implemented
C:\Users\USER\Desktop\Gamemode.pwn(245) : warning 217: loose indentation
C:\Users\USER\Desktop\Gamemode.pwn(246) : error 017: undefined symbol "PRESSED"
C:\Users\USER\Desktop\Gamemode.pwn(246) : error 036: empty statement
C:\Users\USER\Desktop\Gamemode.pwn(257) : error 017: undefined symbol "newkeys"
C:\Users\USER\Desktop\Gamemode.pwn(265) : error 017: undefined symbol "newkeys"
C:\Users\USER\Desktop\Gamemode.pwn(266) : warning 217: loose indentation
C:\Users\USER\Desktop\Gamemode.pwn(269) : error 030: compound statement not closed at the end of file (started at line 97)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
9 Errors.
And here is the part of the script with errors:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{ SendClientMessage(playerid, COLOR_DARKGREY, "You have enter a vehicle! Type /tune1-3 if you want to tune a car");
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(PRESSED,("KEY_SUBMISSION);
{
new vehicleid = GetPlayerVehicleID(playerid);
if(IsPlayerInVehicle(playerid, vehicleid))
{
SetVehicleHealth(vehicleid,1000.0);
RepairVehicle(GetPlayerVehicleID(playerid));
PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
SendClientMessage(playerid,COLOR_YELLOW,"Vehicle fixed!");
}
}
if(PRESSED(KEY_ACTION))
{
if(IsPlayerNotInVehicle(playerid))
{
SendClientMessage(playerid,COLOR_YELLOW,"You have to be in a vehicle!");
}
}
{if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && (newkeys & KEY_ACTION || newkeys & KEY_FIRE)) AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
return 1;
}
}
Any help I will totally appreciate it
Here are the errors:
C:\Users\USER\Desktop\Gamemode.pwn(239) : warning 217: loose indentation
C:\Users\USER\Desktop\Gamemode.pwn(239) : error 029: invalid expression, assumed zero
C:\Users\USER\Desktop\Gamemode.pwn(239) : error 004: function "OnPlayerEnterVehicle" is not implemented
C:\Users\USER\Desktop\Gamemode.pwn(244) : warning 225: unreachable code
C:\Users\USER\Desktop\Gamemode.pwn(244) : error 029: invalid expression, assumed zero
C:\Users\USER\Desktop\Gamemode.pwn(244) : error 004: function "OnPlayerKeyStateChange" is not implemented
C:\Users\USER\Desktop\Gamemode.pwn(245) : warning 217: loose indentation
C:\Users\USER\Desktop\Gamemode.pwn(246) : error 017: undefined symbol "PRESSED"
C:\Users\USER\Desktop\Gamemode.pwn(246) : error 036: empty statement
C:\Users\USER\Desktop\Gamemode.pwn(257) : error 017: undefined symbol "newkeys"
C:\Users\USER\Desktop\Gamemode.pwn(265) : error 017: undefined symbol "newkeys"
C:\Users\USER\Desktop\Gamemode.pwn(266) : warning 217: loose indentation
C:\Users\USER\Desktop\Gamemode.pwn(269) : error 030: compound statement not closed at the end of file (started at line 97)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
9 Errors.
And here is the part of the script with errors:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{ SendClientMessage(playerid, COLOR_DARKGREY, "You have enter a vehicle! Type /tune1-3 if you want to tune a car");
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(PRESSED,("KEY_SUBMISSION);
{
new vehicleid = GetPlayerVehicleID(playerid);
if(IsPlayerInVehicle(playerid, vehicleid))
{
SetVehicleHealth(vehicleid,1000.0);
RepairVehicle(GetPlayerVehicleID(playerid));
PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
SendClientMessage(playerid,COLOR_YELLOW,"Vehicle fixed!");
}
}
if(PRESSED(KEY_ACTION))
{
if(IsPlayerNotInVehicle(playerid))
{
SendClientMessage(playerid,COLOR_YELLOW,"You have to be in a vehicle!");
}
}
{if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && (newkeys & KEY_ACTION || newkeys & KEY_FIRE)) AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
return 1;
}
}
Any help I will totally appreciate it