21.02.2014, 20:14
https://sampforum.blast.hk/showthread.php?tid=79709
Something like this (using zcmd and sscanf):
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;
}