Why does this not work? - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Why does this not work? (
/showthread.php?tid=103709)
Why does this not work? -
BP13 - 20.10.2009
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid)
{
if(IsPlayerInAnyVehicle(playerid) && PlayerIsInDM[playerid] == false)
{
SetVehicleHealth(GetPlayerVehicleID(playerid), 999999.0);
}
if(IsPlayerInAnyVehicle(playerid) && PlayerIsInDM[playerid] == true)
{
SetVehicleHealth(GetPlayerVehicleID(playerid), 1000.0);
}
return 1;
}
Re: Why does this not work? -
BP13 - 20.10.2009
Thought this would work. But I have errors.
pawn Код:
public OnPlayerStateChange(playerid,newstate,oldstate)
{
if(IsPlayerInAnyVehicle(playerid) && oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER) && PlayerIsInDM[playerid] == false)
{
SetVehicleHealth(GetPlayerVehicleID(playerid), 999999.0);
}
if(IsPlayerInAnyVehicle(playerid) && oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER) && PlayerIsInDM[playerid] == true)
{
SetVehicleHealth(GetPlayerVehicleID(playerid), 1000.0);
}
return 1;
}
Код:
C:\DOCUME~1\User\Desktop\MYNEWE~1\GAMEMO~1\SU.pwn(14436) : error 029: invalid expression, assumed zero
C:\DOCUME~1\User\Desktop\MYNEWE~1\GAMEMO~1\SU.pwn(14436) : warning 215: expression has no effect
C:\DOCUME~1\User\Desktop\MYNEWE~1\GAMEMO~1\SU.pwn(14436) : error 001: expected token: ";", but found ")"
C:\DOCUME~1\User\Desktop\MYNEWE~1\GAMEMO~1\SU.pwn(14436) : error 029: invalid expression, assumed zero
C:\DOCUME~1\User\Desktop\MYNEWE~1\GAMEMO~1\SU.pwn(14436) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
the line that has the errors is this line.
pawn Код:
if(IsPlayerInAnyVehicle(playerid) && oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER) && PlayerIsInDM[playerid] == false)