Sripting Help - Tazer -
Vincent_Johnson - 28.01.2011
Ok so a friend of mine is building a shootable tazer, but has the problem of these errors (script for tazers at the bottom). if one of you know how to fix it, and can tell me, that'd be great
C:\Documents and Settings\gary\My Documents\NNRP\gamemodes\sacgta40.pwn(40456) : error 055: start of function body without function header
C:\Documents and Settings\gary\My Documents\NNRP\gamemodes\sacgta40.pwn(40457) : error 010: invalid function or declaration
C:\Documents and Settings\gary\My Documents\NNRP\gamemodes\sacgta40.pwn(40459) : error 010: invalid function or declaration
C:\Documents and Settings\gary\My Documents\NNRP\gamemodes\sacgta40.pwn(40461) : error 010: invalid function or declaration
C:\Documents and Settings\gary\My Documents\NNRP\gamemodes\sacgta40.pwn(40463) : error 010: invalid function or declaration
C:\Documents and Settings\gary\My Documents\NNRP\gamemodes\sacgta40.pwn(40474) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
6 Errors.
public OnPlayerUpdate(playerid)
{
if(IsPlayerInAnyVehicle(playerid) == 1 && Seatbelt[playerid] == 0)
{
new Float:TempCarHealth;
GetVehicleHealth(GetPlayerVehicleID(playerid), TempCarHealth);
new Float
ifference = floatsub(CarHealth[playerid], TempCarHealth);
if((floatcmp(CarHealth[playerid], TempCarHealth) == 1) && (floatcmp(Difference,100.0) == 1))
{
Difference = floatdiv(Difference, 10.0);
new Float:OldHealth;
GetPlayerHealth(playerid, OldHealth);
SetPlayerHealth(playerid, floatsub(OldHealth, Difference));
}
CarHealth[playerid] = TempCarHealth;
}
else
{
CarHealth[playerid] = 0.0; //To aviod that a player dies when he enters a vehicle
}
return 1;
}
//tazer
40456:{
40457: if(Keys & KEY_FIRE)
{
40459: if(GetPlayerWeapon(playerid) == 23 && PlayerHasTazer[playerid] == 1)
{
40461: if(IsPlayerAimingAtPlayer(playerid, i))
{
40463: if(PlayerCuffed[i]) return 1;
TogglePlayerControllable(i, 0);
SetTimerEx("TazerTimer", 8000, false, "i", playerid);
TazerTime[playerid] = 1;
GameTextForPlayer(i, "~r~Tazed", 2500, 3);
PlayerCuffed[i] = 1;
PlayerCuffedTime[i] = 8;
ApplyAnimation(i, "PED","FLOOR_hit_f", 4.0, 1, 0, 0, 0, 0);
}
}
}
40474 return 1;
}