17.05.2020, 19:46
hi, i need /carwhisper command (/cw) please...
Thanks
Thanks
What is it with all the people requesting command like it's a script request forum...
You didn't even give a proper explanation of what your command is supposed to do. Post whatever code snippet you already have. If you're looking for a person to do it for you, this is the wrong place, look at here instead: Looking for scripters/helpers? Post here! |
CMD:cw(playerid, params[]) { static userid; if (sscanf(params, "u", userid)) return SendSyntaxMessage(playerid, "/cw [text]"); new string[128]; for(new i = 0; i < MAX_PLAYERS; i ++) if(IsPlayerInVehicle(i, GetPlayerVehicleID(i))) SendClientMessage(playerid, COLOR_YELLOW, string); return 1; }
new string[128]; for(new i = 0; i < MAX_PLAYERS; i ++) if(IsPlayerInVehicle(i, GetPlayerVehicleID(i))) SendClientMessage(playerid, COLOR_YELLOW, string);
SendClientMessage(i, COLOR_YELLOW, string);
if (sscanf(params, "u", userid)) return SendSyntaxMessage(playerid, "/cw [text]");
new string[128]; //or any size. if (sscanf(params, "s[128]", string)) return SendSyntaxMessage(playerid, "/cw [text]");
new pstate[128];
switch(GetPlayerState(playerid))
{
case PLAYER_STATE_DRIVER: pstate = "Driver";
case PLAYER_STATE_PASSENGER: pstate = "Passenger";
}
new pname[MAX_PLAYER_NAME+1], msg[128];
GetPlayerName(playerid, pname, sizeof pname);
//format for sending message with player state and name and message
format(msg, 128, "%s %s (%d): %s", pstate, pname, playerid, msg);
for(new i = 0; i < MAX_PLAYERS; i++) {
if(IsPlayerInVehicle(i, GetPlayerVehicleID(playerid)))
{
SendClientMessage(i, -1, msg);
}
}