SA-MP Forums Archive
OnPlayerEnterVehicle - 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: OnPlayerEnterVehicle (/showthread.php?tid=201667)



OnPlayerEnterVehicle - Noss* - 21.12.2010

Solved


Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if (vehicleid == 562)
    {
        AddVehicleComponent(562, 1010); // Nitro
        SendClientMessage(playerid, 0xFFFFFFAA, "Nitro Added.");

	return 1;
}
Код:
C:\DOCUME~1\Barteka\Desktop\SA-MPS~1\GAMEMO~1\NOSSDR~1.PWN(241) : warning 217: loose indentation
C:\DOCUME~1\Barteka\Desktop\SA-MPS~1\GAMEMO~1\NOSSDR~1.PWN(244) : warning 217: loose indentation
C:\DOCUME~1\Barteka\Desktop\SA-MPS~1\GAMEMO~1\NOSSDR~1.PWN(244) : error 029: invalid expression, assumed zero
C:\DOCUME~1\Barteka\Desktop\SA-MPS~1\GAMEMO~1\NOSSDR~1.PWN(244) : error 004: function "OnPlayerExitVehicle" is not implemented
C:\DOCUME~1\Barteka\Desktop\SA-MPS~1\GAMEMO~1\NOSSDR~1.PWN(249) : warning 225: unreachable code
C:\DOCUME~1\Barteka\Desktop\SA-MPS~1\GAMEMO~1\NOSSDR~1.PWN(249) : error 029: invalid expression, assumed zero
C:\DOCUME~1\Barteka\Desktop\SA-MPS~1\GAMEMO~1\NOSSDR~1.PWN(249) : error 004: function "OnPlayerStateChange" is not implemented
C:\DOCUME~1\Barteka\Desktop\SA-MPS~1\GAMEMO~1\NOSSDR~1.PWN(254) : warning 225: unreachable code
C:\DOCUME~1\Barteka\Desktop\SA-MPS~1\GAMEMO~1\NOSSDR~1.PWN(254) : error 029: invalid expression, assumed zero
C:\DOCUME~1\Barteka\Desktop\SA-MPS~1\GAMEMO~1\NOSSDR~1.PWN(254) : error 004: function "OnPlayerEnterCheckpoint" is not implemented
C:\DOCUME~1\Barteka\Desktop\SA-MPS~1\GAMEMO~1\NOSSDR~1.PWN(259) : warning 225: unreachable code
C:\DOCUME~1\Barteka\Desktop\SA-MPS~1\GAMEMO~1\NOSSDR~1.PWN(259) : error 029: invalid expression, assumed zero
C:\DOCUME~1\Barteka\Desktop\SA-MPS~1\GAMEMO~1\NOSSDR~1.PWN(259) : error 004: function "OnPlayerLeaveCheckpoint" is not implemented
C:\DOCUME~1\Barteka\Desktop\SA-MPS~1\GAMEMO~1\NOSSDR~1.PWN(264) : warning 225: unreachable code
C:\DOCUME~1\Barteka\Desktop\SA-MPS~1\GAMEMO~1\NOSSDR~1.PWN(264) : error 029: invalid expression, assumed zero
C:\DOCUME~1\Barteka\Desktop\SA-MPS~1\GAMEMO~1\NOSSDR~1.PWN(264) : error 004: function "OnPlayerEnterRaceCheckpoint" is not implemented
C:\DOCUME~1\Barteka\Desktop\SA-MPS~1\GAMEMO~1\NOSSDR~1.PWN(269) : warning 225: unreachable code
C:\DOCUME~1\Barteka\Desktop\SA-MPS~1\GAMEMO~1\NOSSDR~1.PWN(269) : error 029: invalid expression, assumed zero
Thanks for reading.


Re: OnPlayerEnterVehicle - JaTochNietDan - 21.12.2010

The problem seems obvious, you are missing a bracket, can you not see that?

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if (vehicleid == 562)
    {
        AddVehicleComponent(562, 1010); // Nitro
        SendClientMessage(playerid, 0xFFFFFFAA, "Nitro Added.");
    }
    return 1;
}



Respuesta: Re: OnPlayerEnterVehicle - admantis - 21.12.2010

Quote:
Originally Posted by JaTochNietDan
Посмотреть сообщение
The problem seems obvious, you are missing a bracket, can you not see that?

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if (vehicleid == 562)
    {
        AddVehicleComponent(562, 1010); // Nitro
        SendClientMessage(playerid, 0xFFFFFFAA, "Nitro Added.");
    }
    return 1;
}
This wont work! OnPlayerEnterVehicle is called ONLY when you press intro to enter a car, not when your in it!
So use OnPlayerStateChange.