Bug Help me! - 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)
+--- Thread: Bug Help me! (
/showthread.php?tid=308214)
Bug Help me! -
Artie_Scorpion - 02.01.2012
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if( oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER )
{
//If they got into a car from being on foot.
if( GetVehicleModel(GetPlayerVehicleID( playerid )) == 428 || 520) //naudoti || masina ||
{
if( GetPlayerSkin(playerid) != 27 || 287) //naudoti || skinas ||
{
//If their skin is not 27
//Remove them and send message.
RemovePlayerFromVehicle( playerid );
SendClientMessage( playerid,0xFF000000, "My Text" );//-1
return 1;
}
else
{
SendClientMessage(playerid, 0xFF000000, "My Text");
return 1;
}
}
}
return 1;
}
I added this code into my gamemode. After that, my riding NPC has been teleported near spawn, and the BUS was near him. How can i make this code for more skins and more vehicles. Ex. Hydra for soldier skin, police car for officer...