16.06.2011, 18:47
I post it for you if you don't want to search ^^
pawn Код:
if(strcmp(cmd,"/cw",true)==0)
{
if(IsSpawned[playerid] == 0) {
SendClientMessage(playerid, COLOR_ERROR, "You are dead. You cannot use this command");
return 1;
}
if(!IsPlayerInAnyVehicle(playerid)) {
SendClientMessage(playerid, COLOR_ERROR, "You not in any vehicle. You cannot use this command");
return 1;
}
if(strlen(cmdtext) <= 4) {
SendClientMessage(playerid,COLOR_ERROR,"USAGE: /cw (msg)");
return 1;
}
new cwhisperid = GetPlayerVehicleID(playerid);
new output[150];
new pname[24];
GetPlayerName(playerid, pname, 24);
strmid(output,cmdtext,3,strlen(cmdtext));
format(string, sizeof(string), "(CAR WHISPER): %s(%d) %s",pname,playerid,output);
printf("%s", string);
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerInAnyVehicle(i))
{
if(GetPlayerVehicleID(i) == cwhisperid)
{
format(string, sizeof(string), "(CAR WHISPER): %s(%d) %s",pname,playerid,output);
SendClientMessage(i,COLOR_YELLOW,string);
}
}
}
return 1;
}