Combining Commands
#8

Quote:
Originally Posted by xXRealLegitXx
Посмотреть сообщение
I entered

Код:
CMD:e(playerid, params[])
{
        if(GetPlayerState(playerid) != 2)return SendClientMessage(playerid, GREY, "You can't start a started car.");
        if(HotWired[vehicle] == 1)return SendClientMessage(playerid, GREY, "This car you hot wired you can't turn it on or off");
        new vehicle = GetPlayerVehicleID(playerid);
        if(Engine[vehicle] == 0)
        {
            new engine, lights, alarm, doors, bonnet, boot, objective;
            GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
            Engine[vehicle] = 1;
            SetVehicleParamsEx(vehicle, 1, lights, alarm, doors, bonnet, boot, 0);
        }
        else if(Engine[vehicle] == 1)
        {
            new engine, lights, alarm, doors, bonnet, boot, objective;
            Engine[vehicle] = 0;
            GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
            SetVehicleParamsEx(vehicle, 0, lights, alarm, doors, bonnet, boot, 0);
        }
        return 1;
}
CMD:hotwire(playerid, params[])
{
        if(GetPlayerState(playerid) != 2)return SendClientMessage(playerid, GREY, "You must be a driver to use this command.");
        new vehicle = GetPlayerVehicleID(playerid);
        if(Engine[vehicle] == 1)
        {
            new engine, lights, alarm, doors, bonnet, boot, objective;
            GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
            Engine[vehicle] = 1;
            SetVehicleParamsEx(vehicle, 1, lights, alarm, doors, bonnet, boot, 0);
            HotWired[vehicleid] = 1;
            SendClientMessage(playerid, GREY, "Now you can't turn off your car?");
        }
        return 1;
}
and got

Код:
C:\Users\Jason\Desktop\205.234.152.184_7780\gamemodes\OGRP.pwn(1534) : error 017: undefined symbol "vehicle"
C:\Users\Jason\Desktop\205.234.152.184_7780\gamemodes\OGRP.pwn(1562) : error 017: undefined symbol "vehicleid"
C:\Users\Jason\Desktop\205.234.152.184_7780\gamemodes\OGRP.pwn(1630) : error 017: undefined symbol "i"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
1534 =
Код:
if(HotWired[vehicle] == 1)return SendClientMessage(playerid, GREY, "This car you hot wired you can't turn it on or off");
1562 =
Код:
HotWired[vehicleid] = 1;
1630 = My own error, and I will deal with it.
I think I've found an error:

Everywhere it's written: Engine[vehicle],... but then for HotWire you suddenly use vehicleid, so change it to this:

pawn Код:
HotWire[vehicle] = 1;
EDIT: and to fix the other error at /e, put the variable vehicle BEFORE everything else, that should fix it, so not this:

pawn Код:
if(GetPlayerState(playerid) != 2)return SendClientMessage(playerid, GREY, "You can't start a started car.");
        if(HotWired[vehicle] == 1)return SendClientMessage(playerid, GREY, "This car you hot wired you can't turn it on or off");
        new vehicle = GetPlayerVehicleID(playerid);
But this:

pawn Код:
new vehicle = GetPlayerVehicleID(playerid);
       if(GetPlayerState(playerid) != 2)return SendClientMessage(playerid, GREY, "You can't start a started car.");
        if(HotWired[vehicle] == 1)return SendClientMessage(playerid, GREY, "This car you hot wired you can't turn it on or off");
Reply


Messages In This Thread
Combining Commands - by xXRealLegitXx - 15.02.2013, 08:18
Re: Combining Commands - by DaRk_RaiN - 15.02.2013, 08:39
Re: Combining Commands - by xXRealLegitXx - 15.02.2013, 08:49
Re: Combining Commands - by DaRk_RaiN - 15.02.2013, 09:14
Re: Combining Commands - by xXRealLegitXx - 15.02.2013, 09:36
Re: Combining Commands - by xXRealLegitXx - 15.02.2013, 09:40
Re: Combining Commands - by DaRk_RaiN - 15.02.2013, 09:40
Re: Combining Commands - by Da_Noob - 15.02.2013, 10:05
Re: Combining Commands - by xXRealLegitXx - 15.02.2013, 10:16
Re: Combining Commands - by xXRealLegitXx - 15.02.2013, 10:19

Forum Jump:


Users browsing this thread: 4 Guest(s)