Can anyone help me with my script
#1

pawn Код:
if (strcmp("/tune", cmdtext, true, 10) == 0)
    {   if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_RED2,"You must be in a vehicle");
        {
        new veh;
        veh = GetPlayerVehicleID(playerid);
        if(IsValidNosVehicle(veh)) return SendClientMessage(playerid,COLOR_RED2,"You can't tune this vehicle");
        AddVehicleComponent(veh,1000);
        PlayerPlaySound(playerid, 1097, 0.0, 0.0, 0.0);
        ChangeVehicleColor(veh,0,0);
        AddVehicleComponent(veh,1078);
        AddVehicleComponent(veh,1087);
        SendClientMessage(playerid,COLOR_PINK,"Vehicle tunned!!");

        }
        return 1;
    }
I've got that but its rly bugged..

Hard to explain why but i'll try

When im in a vehicle and i type /tune it'll say you must be in a vehicle and if you type it out of the car itt will say You can't tune this vehicle

help..
Reply
#2

Anyone??
Reply
#3

Quote:
Originally Posted by [BADBOY]
Посмотреть сообщение
pawn Код:
if (strcmp("/tune", cmdtext, true, 10) == 0)
    {   if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_RED2,"You must be in a vehicle");
        {
        new veh;
        veh = GetPlayerVehicleID(playerid);
        if(IsValidNosVehicle(veh)) return SendClientMessage(playerid,COLOR_RED2,"You can't tune this vehicle");
        AddVehicleComponent(veh,1000);
        PlayerPlaySound(playerid, 1097, 0.0, 0.0, 0.0);
        ChangeVehicleColor(veh,0,0);
        AddVehicleComponent(veh,1078);
        AddVehicleComponent(veh,1087);
        SendClientMessage(playerid,COLOR_PINK,"Vehicle tunned!!");

        }
        return 1;
    }
I've got that but its rly bugged..

Hard to explain why but i'll try

When im in a vehicle and i type /tune it'll say you must be in a vehicle and if you type it out of the car itt will say You can't tune this vehicle

help..
i think you mean this
pawn Код:
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_RED2,"You must be in a vehicle");
if(!IsValidNosVehicle(veh)) return SendClientMessage(playerid,COLOR_RED2,"You can't tune this vehicle");
You simply forgot the !
Reply
#4

Quote:
Originally Posted by selten98
Посмотреть сообщение
i think you mean this
pawn Код:
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,COLOR_RED2,"You must be in a vehicle");
if(!IsValidNosVehicle(veh)) return SendClientMessage(playerid,COLOR_RED2,"You can't tune this vehicle");
You simply forgot the !
Thank you!

EDIT: Oh i fixed it myself!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)