Jump to content

Question

Posted

am o problema in script jobul ie facut uitati

if(strcmp(cmd,"/tow",true)==0)

{

    if(IsPlayerConnected(playerid)) {

        if(PlayerInfo[playerid][pJob] == 7 || PlayerInfo[playerid][pMember] == 1 ||PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pMember] == 4||PlayerInfo[playerid][pMember] == 14  ) {

            if(IsPlayerInAnyVehicle(playerid)) {

                if (GetVehicleModel(GetPlayerVehicleID(playerid)) == 525) {

                    if(GetPlayerState(playerid)==2) {

                        new Float:pX,Float:pY,Float:pZ;

                        GetPlayerPos(playerid,pX,pY,pZ);

                        new Float:vX,Float:vY,Float:vZ;

                        new Found=0;

                        new vid=0;

                        while((vid<MAX_VEHICLES)&&(!Found)) {

                            vid++;

                            GetVehiclePos(vid,vX,vY,vZ);

                            if ((floatabs(pX-vX)<7.0)&&(floatabs(pY-vY)<7.0)&&(floatabs(pZ-vZ)<7.0)&&(vid!=GetPlayerVehicleID(playerid))) {

                                Found=1;

                                if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid))) {

                                    DetachTrailerFromVehicle(GetPlayerVehicleID(playerid));

                                }

                                else {

                                    if (PlayerToPoint(20.0,playerid,VehicleInfo[vid][CarSpawnX],VehicleInfo[vid][CarSpawnY],VehicleInfo[vid][CarSpawnZ])) {

                                        if(!IsAnOwnableCar(vid)) {

                                            SendClientMessage(playerid, COLOR_GRAD2, "This vehicle does not need to be towed!");

                                            return 1;

                                        }

                                    }

                                    AttachTrailerToVehicle(vid,GetPlayerVehicleID(playerid));

                                }

                            }

                        }

                        if(!Found) {

                            SendClientMessage(playerid,0xFFFF00AA,"  There is no car in range.");

                        }

                    }

                    else {

                        SendClientMessage(playerid, COLOR_GRAD2, "  You need to be the driver!");

                        return 1;

                    }

                }

                else {

                    SendClientMessage(playerid, COLOR_GRAD2, "  You need to be in a Tow truck to use this!");

                    return 1;

                }

            }

            else {

                SendClientMessage(playerid, COLOR_GRAD2, "  You need to be in a vehicle to do this!");

                return 1;

            }

        }

        else {

            SendClientMessage(playerid,COLOR_GRAD2,"  You need to be a Mechanic or in the PD to use this!");

            return 1;

        }

    }

    return 1;

}

if(strcmp(cmd, "/refill", true) == 0)

{

    if(IsPlayerConnected(playerid)) {

        if(PlayerInfo[playerid][pJob] != 7) {

            SendClientMessage(playerid,COLOR_GRAD3,"  You are not a Car Mechanic!");

            return 1;

        }

        if(PlayerInfo[playerid][pConnectTime] == 0) {

            SendClientMessage(playerid,COLOR_GRAD3,"You need atleast one Connect Time point to use this !");

            return 1;

        }

        tmp = strtok(cmdtext, idx);

        if(!strlen(tmp)) {

            SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /refill [playerid/PartOfName] [price]");

            return 1;

        }

        new playa;

        new money;

        playa = ReturnUser(tmp);

        tmp = strtok(cmdtext, idx);

        money = strval(tmp);

        if(PlayerInfo[playa][pConnectTime] == 0) {

            SendClientMessage(playerid,COLOR_GRAD3,"This person needs atleast one Connect Time point to use this !");

            return 1;

        }

        if(money < 1 || money > 99999) {    SendClientMessage(playerid,COLOR_GRAD3,"  Price not lower then 1, or above 99999!"); return 1; }

        if(IsPlayerConnected(playa)) {

            if(playa != INVALID_PLAYER_ID) {

                if(ProxDetectorS(8.0, playerid, playa)&& IsPlayerInAnyVehicle(playa)) {

                    if(playa == playerid) {    SendClientMessage(playerid,COLOR_GRAD3,"  Can't do that!"); return 1; }

                    GetPlayerName(playa, giveplayer, sizeof(giveplayer));

                    GetPlayerName(playerid, sendername, sizeof(sendername));

                    format(string, sizeof(string), "* You offerd %s to refill there car for $%d .",giveplayer,money);

                    SendClientMessage(playerid, COLOR_GREEN, string);

                    format(string, sizeof(string), "* Car Mechanic %s wants to refill your car for $%d, (type /accept refill) to accept.",sendername,money);

                    SendClientMessage(playa, COLOR_GREEN, string);

                    RefillOffer[playa] = playerid;

                    RefillPrice[playa] = money;

                }

                else {

                    SendClientMessage(playerid,COLOR_GRAD3,"  That player is not near you / not in a car.");

                }

            }

        }

        else {

            SendClientMessage(playerid,COLOR_GRAD3,"  That player is offline.");

        }

    }

    return 1;

}

if(strcmp(cmd, "/repair", true) == 0)

{

    if(IsPlayerConnected(playerid)) {

        if(PlayerInfo[playerid][pJob] != 7) {

            SendClientMessage(playerid,COLOR_GRAD3,"  You are not a Car Mechanic!");

            return 1;

        }

        tmp = strtok(cmdtext, idx);

        if(!strlen(tmp)) {

            SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /repair [playerid/PartOfName] [price]");

            return 1;

        }

        new playa;

        new money;

        playa = ReturnUser(tmp);

        tmp = strtok(cmdtext, idx);

        money = strval(tmp);

        if(PlayerInfo[playa][pConnectTime] == 0) {

            SendClientMessage(playerid,COLOR_GRAD3,"This person needs atleast one Connect Time point to use this !");

            return 1;

        }

        if(money < 1 || money > 99999) {    SendClientMessage(playerid,COLOR_GRAD3,"  Price not lower then 1, or above 99999!"); return 1; }

        if(IsPlayerConnected(playa)) {

            if(playa != INVALID_PLAYER_ID) {

                if(ProxDetectorS(8.0, playerid, playa)&& IsPlayerInAnyVehicle(playa)) {

                    if(playa == playerid) {    SendClientMessage(playerid,COLOR_GRAD3,"  Can't do that!"); return 1; }

                    GetPlayerName(playa, giveplayer, sizeof(giveplayer));

                    GetPlayerName(playerid, sendername, sizeof(sendername));

                    format(string, sizeof(string), "* You offerd %s to fix there car for $%d .",giveplayer,money);

                    SendClientMessage(playerid, COLOR_PURPLE, string);

                    format(string, sizeof(string), "* Car Mechanic %s wants to repair your car for $%d, (type /accept repair) to accept.",sendername,money);

                    SendClientMessage(playa, COLOR_GREEN, string);

                    RepairOffer[playa] = playerid;

                    RepairPrice[playa] = money;

                }

                else {

                    SendClientMessage(playerid,COLOR_GRAD3,"  That player is not near you / not in a car.");

                }

            }

        }

        else {

            SendClientMessage(playerid,COLOR_GRAD3,"  That player is offline.");

        }

    }

    return 1;

}

totul merge dar in joc dau /repair sau /tow si imi spune ca aceasta comanda nu exista.

Ma puteti ajuta cum pot face asta?

1 answer to this question

Recommended Posts

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.