Someone help me...
#1

Hi,


Is there any way to know who sits in the vehicle near me ?

Like im driver i write : /whosits and it shows me who sit in the co-driver seat ? his or her id ?


Thanks...
Reply
#2

Take a look at wiki https://sampwiki.blast.hk/wiki/GetPlayerVehicleSeat
Reply
#3

with this i cant get my seat but how to get if there is anyone on co-driver seat and whats his or her id...
Reply
#4

hmm i see you could use player stats like if
pawn Код:
(playerState == PLAYER_STATE_PASSENGER )
Reply
#5

no with this nothing happens... need something different...
Reply
#6

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp("/whosits", cmdtext, true))
    {
        new Pname[24], str[75];
        new vid = GetPlayerVehicleID(playerid);
        for(new i; i<MAX_PLAYERS; i++) //Replace to foreach if you use that
        {
            if(IsPlayerConnected(i)
            {
                if(GetPlayerVehicleID(i) == vid && GetPlayerVehicleSeat(i) == 1)
                {
                     GetPlayerName(i, Pname, 24);
                     format(str, sizeof(str), "%s is sitting next to you", Pname);
                     SendClientMessage(playerid, /*COLOR*/, str);
                     break;
                 }
             }
        }
        return 1;
    }
    return 0;
}
Reply
#7

Thank you very much TheKiller
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)