Message in vehicle
#1

Does somebody know a way to send messages to people in the same vehicle.
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=79709

Something like this (using zcmd and sscanf):

pawn Код:
CMD:carmsg(playerid, params[])
{
    new string[128], text[100];
       
    if(sscanf(params, "s[100]", text)) return SendClientMessage(playerid, -1, "USAGE: /carmsg [text]");

    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerConnected(i))
        {
            if(IsPlayerInVehicle(i, GetPlayerVehicleID(playerid)))
            {
                format(string, sizeof(string), "[%s]: %s", GetPlayerName(playerid, string, sizeof(string)), text);
                SendClientMessage(i, -1, string);
                return 1;
            }
        }
    }
    return 1;
}
Reply
#3

Thank You
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)