04.09.2013, 14:24
can i make if someone get in some vehicles get armour or health or something ?
public OnPlayerEnterVehicle(playerid, vehicleid)
{
for( new i; i < MAX_VEHICLES; i++)
{
if(vehicleid == i)
{
Your code
}
}
return 1;
}
public OnPlayerStateChange( playerid, newstate, oldstate )
{
if( newstate == PLAYER_STATE_DRIVER && GetVehicleModel( GetPlayerVehicleID( playerid ) ) == 411 )
{ // If the player is now driver and the vehicle got in is infernus..
SetPlayerHealth( playerid, 100.0 );
SetPlayerArmour( playerid, 100.0 );
}
return 1;
}
public OnPlayerStateChange( playerid, newstate, oldstate )
{
if( newstate == PLAYER_STATE_DRIVER && GetVehicleModel( GetPlayerVehicleID( playerid ) ) == 427 )
{
SetPlayerArmour( playerid, 100.0 );
}
return 1;
}
public OnPlayerStateChange(playerid, newstatse, oldstatse) { if( newstatse == PLAYER_STATSE_DRIVER && GetVehicleModel( GetPlayerVehicleID( playerid) ) == 427 ) { SetPlayerArmour( playerid, 100.0); } return 1; } |
C:\Users\John\samp03x_svr_R1-2_win32\gamemodes\MyFrist.pwn(173) : error 025: function heading differs from prototype C:\Users\John\samp03x_svr_R1-2_win32\gamemodes\MyFrist.pwn(176) : error 017: undefined symbol "PLAYER_STATSE_DRIVER" C:\Users\John\samp03x_svr_R1-2_win32\gamemodes\MyFrist.pwn(195) : error 021: symbol already defined: "OnPlayerStateChange" |
// The below lines
if( newstate == PLAYER_STATE_DRIVER && GetVehicleModel( GetPlayerVehicleID( playerid ) ) == 427 )
{
SetPlayerArmour( playerid, 100.0 );
}
public OnPlayerStateChange( playerid, newstate, oldstate )
{
if( newstate == PLAYER_STATE_DRIVER && GetVehicleModel( GetPlayerVehicleID( playerid ) ) == 427 )
{
SetPlayerArmour( playerid, 100.0 );
}
// Some other code you had..
return 1;
}