Need help
#1

Hello i made up this script but it seems that is bugged

when i do /wheels in a car it says that i dont have any vehicle to tune and when i am on foot it works
or when i type /wheel1 outside of a car it said unknown command instead of You dont' have any vehicle to tune
When i do /wheel1 on a bike it works and it says i can't mod the bike

please help me I did something wrong but dont know what

Here is the pastebin for it
http://pastebin.com/m6facc491
Reply
#2

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(IsPlayerInAnyVehicle(playerid))
I wouldn't recommend you putting the If(IsPlayerInAnyVehicle) under the Command text public, rather put it in the command that you want. IE:

Код:
else if(strcmp(cmdtext, "/anos", true)==0)
{
    if(IsPlayerInAnyVehicle(playerid))
        {

            AddVehicleComponent(GetPlayerVehicleID(playerid),1010);

            PlayerPlaySound(playerid,1133,0.0,0.0,0.0);

            SendClientMessage(playerid,blue,"Nos Added");

            return 1;

        }
and if you are too lazy to type, you can always make it a variable like so:

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new checkforcar = IsPlayerInAnyVehicle(playerid);
and then for your commands
Код:
else if(strcmp(cmdtext, "/anos", true)==0)
{
    if(checkforcar)
        {

            AddVehicleComponent(GetPlayerVehicleID(playerid),1010);

            PlayerPlaySound(playerid,1133,0.0,0.0,0.0);

            SendClientMessage(playerid,blue,"Nos Added");

            return 1;

        }
It may solve you're problem, but I can't say for sure since I didn't test it, but I hope it does, good luck, message me for further assistance.
Reply
#3

Testing it mate thx

EDIT: tested but i had a problem i coul not use any of my GM's cmds or other cmds

http://pastebin.com/m5a202218 i modiffied it to a clasic one whit no restrictions and now i want to add this but i keep fail doing it

Код:
new VID = GetPlayerVehicleID(playerid);
new MOD = GetVehicleModel(VID);
 if (MOD == 448 || MOD == 461 || MOD == 462 || MOD == 463 || MOD == 468 || MOD == 471 || MOD == 509 || MOD == 510 || MOD == 521 || MOD == 522 || MOD== 523 || MOD == 581 || MOD == 586 || MOD == 449)
 {
 SendClientMessage(playerid,blue," You can not tune this vehicle!"); 
 }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)