SendClientMessage(CarInfo[idcar][cOwner]
#1

Hi, when i type /hotwire and people have an alarm system fitted, it must show a message to the owner of the vehicle that is being hotwired "Your vehicle alarm is going off" but it shows that message to the player that is hotwireing.. i hope you Guys understand what i mean

pawn Код:
if(strcmp(cmd, "/hotwire", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pHotwire] == 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "  You don't have a hotwire kit !");
                return 1;
            }
            if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
            {
                if(VehAsk[playerid] == 2 && HotWire[playerid] == 0)
                {
                    new idcar = GetPlayerVehicleID(playerid);
                    if(CarInfo[VehicleOwned[idcar]][cAlarm] == 1)
                    {
                        HotWireTime[playerid] = 60;
                    }
                    else if(CarInfo[VehicleOwned[idcar]][cAlarm] == 2)
                    {
                        HotWireTime[playerid] = 120;
                    }
                    else if(CarInfo[VehicleOwned[idcar]][cAlarm] == 3)
                    {
                        HotWireTime[playerid] = 180;
                    }
                    else if(CarInfo[VehicleOwned[idcar]][cAlarm] == 4)
                    {
                        HotWireTime[playerid] = 300;
                    }
                    else
                    {
                        HotWireTime[playerid] = 30;
                    }
                    SendClientMessage(giveplayerid, COLOR_GREY, string);
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    format(string, sizeof(string), "* %s attempts to break the vehicles kill switch", RemoveUnderScore(playerid));
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                    if(CarInfo[VehicleOwned[idcar]][cAlarm] == 0)
                    {
                        format(string, sizeof(string), "This vehicle has no hotwire protection kit fitted, and takes only {FF6347}30 seconds"COL_GREY" to hotwire!");
                    }
                    else
                    {
                        format(string, sizeof(string), "This is a level %d kill switch, it will take {FF6347}%d seconds"COL_GREY" to break!", CarInfo[VehicleOwned[idcar]][cAlarm], HotWireTime[playerid]);
                    }
                    SendClientMessage(playerid, COLOR_GREY, string);
                    SendClientMessage(playerid, 0xAFAFAFAA, "/exitvehicle to cancel the attempt");
                    HotWire[playerid] = 1;

                    GetVehicleParamsEx(idcar,engine,lights,alarm,doors,bonnet,boot,objective);
                    SetVehicleParamsEx(idcar,engine,lights,VEHICLE_PARAMS_ON,doors,bonnet,boot,objective);
                    if(CarInfo[VehicleOwned[idcar]][cAlarm] == 1)
                    {
                        SendClientMessage(CarInfo[idcar][cOwner],0xAA3333AA, "Your vehicle alarm is going off!");
                    }
                    if(CarInfo[VehicleOwned[idcar]][cAlarm] == 2)
                    {
                        SendClientMessage(CarInfo[idcar][cOwner],0xAA3333AA, "Your vehicle alarm is going off!");
                    }
                    if(CarInfo[VehicleOwned[idcar]][cAlarm] == 3)
                    {
                        SendClientMessage(CarInfo[idcar][cOwner],0xAA3333AA, "Your vehicle alarm is going off! follow the red marker!");
                        new Float:x,Float:y,Float:pz;
                        GetPlayerPos(playerid,x,y,pz);
                        SetPlayerCheckpoint(CarInfo[idcar][cOwner],x,y,pz, 5.0);
                    }
                    if(CarInfo[VehicleOwned[idcar]][cAlarm] == 4)
                    {
                        format(string, sizeof(string), "Your vehicle alarm is going off ( %s ) follow the red marker!", RemoveUnderScore(playerid));
                        SendClientMessage(CarInfo[idcar][cOwner], 0xAA3333AA, string);
                        new Float:x,Float:y,Float:pz;
                        GetPlayerPos(playerid,x,y,pz);
                        SetPlayerCheckpoint(CarInfo[idcar][cOwner],x,y,pz, 5.0);
                    }
                }
                else
                {
                    SendClientMessage(playerid,COLOR_GREY,"You can't do this right now!");
                }
            }
            else
            {
                SendClientMessage(playerid,COLOR_GREY,"You are not in a vehicle!");
            }
            return 1;
        }
    }
Reply
#2

it still doesnt Work
Reply
#3

Anyone?
Reply
#4

Whats the script do if (CarInfo[idcar][cOwner]) is not connected ?
Reply
#5

Show what is the CarInfo[idcar][cOwner] , мn order to work it must store the owner's current ID, show me how you assign his ID to CarInfo[idcar][cOwner].
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)