Jump to content

taxi


Sun23Wn

Recommended Posts

new intaxi[MAX_PLAYERS];
pui de exemplu cand intri intr-o masina de taxi, intaxi[playerid] = 1;
apoi cand iesi din masina intaxi[playerid] = 0;

public OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ)
{
 if( intaxi[playerid] == 1) {
	new taxidriver = WhoIsDriver(GetPlayerVehicleID(playerid));
    SetPlayerCheckPoint(taxidriver,fX, fY, fZ);
    CP[taxidriver] = 929;
    SendClientMessage(taxidriver,-1,"Pasagerul a ales destiantia!");
    SendClientMessage(playerid,-1,"Ai ales destinatia");
 }
 return 1;
}
apoi mergi la
public OnPlayerEnterCheckpoint(playerid)
{
   switch(CP[playerid]) {
       case 929: {
       SendClientMessage(playerid,-1,"Ai adus playerul la destinatie!");
       DisablePlayerCheckPoints(playerid);
       CP[playerid] = 0;
       }
   }
}

// este un stock gasit la repezeala de pe net, nu recomand, dar daca esti incepator nu te complica
stock WhoIsDriver(vehicleid)
{
    for(new i = 0; i < MAX_PLAYERS; i++) //Loops through all players
    {
        if(GetPlayerVehicleID(i) == vehicleid && GetPlayerState(i) == PLAYER_STATE_DRIVER) return i; //Returns playerid if the player is in the vehicleid provided AND is the driver
    }
    return 1;
}

sper ca ai inteles ceva, l am facut la repezeala

asta e o baza, poti sa continui singur mai departe.

aqpUjAc.png

 

 

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.