Jump to content
  • 0

pomoc Pozice hráče v autě


SwagManCZ

Dotaz

3 odpovědí na tuto otázku

Recommended Posts

  • 0
public OnPlayerStateChange(playerid, newstate, oldstate)
{
   if(newstate == PLAYER_STATE_DRIVER)
   {
      SendClientMessage(playerid,0xFFFFFFAA,"Jsi řidič");
   }
   else
   {
      SendClientMessage(playerid,0xFFFFFFAA,"Jsi spolujezdec");
   }
}

nebo pokud chceš zjistit třeba na příkaz nějakého hráče, jestli sedí v autě a je řidič, nebo pasažér, tak použij tuto funkci:

 

 

GetPlayerState(playerid) == PLAYER_STATE_DRIVER // toto znamená že je řidič
GetPlayerState(playerid) == PLAYER_STATE_PASSENGER // toto znamená že je pasažér

 

a dej si to do podmínky např:

if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
    SendClientMessage(playerid,0xFFFFFFAA,"Tento hráč je řidič");
}
else
{
    SendClientMessage(playerid,0xFFFFFFAA,"Tento hráč je pasažér");
}
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...