Text only in vehicle?
#2

I looked over this and it should work fine, credits to Shidony
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;
    }
Reply


Messages In This Thread
Text only in vehicle? - by Lajko1 - 20.02.2014, 21:48
Re: Text only in vehicle? - by Flake. - 21.02.2014, 00:50
Re: Text only in vehicle? - by Aerotactics - 21.02.2014, 06:18
Re: Text only in vehicle? - by Lajko1 - 21.02.2014, 17:15
Re: Text only in vehicle? - by Lajko1 - 21.02.2014, 21:34
Re: Text only in vehicle? - by Dignity - 21.02.2014, 21:50
Re: Text only in vehicle? - by Scenario - 21.02.2014, 22:20
Re: Text only in vehicle? - by Threshold - 21.02.2014, 23:49
Re: Text only in vehicle? - by Lajko1 - 27.02.2014, 14:25
Re: Text only in vehicle? - by Threshold - 27.02.2014, 22:04

Forum Jump:


Users browsing this thread: 2 Guest(s)