Message in vehicle
#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


Messages In This Thread
Message in vehicle - by yancarlos4500 - 21.02.2014, 20:03
Re: Message in vehicle - by Dignity - 21.02.2014, 20:14
Re: Message in vehicle - by yancarlos4500 - 21.02.2014, 20:48

Forum Jump:


Users browsing this thread: 1 Guest(s)