Retarded Errors
#1

Код:
C:\Users\Madhouse\Desktop\Server\gamemodes\DRPG.pwn(86) : error 017: undefined symbol "vehicleid"
C:\Users\Madhouse\Desktop\Server\gamemodes\DRPG.pwn(140) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/repairkit", cmdtext, true) == 0)
    {
    new Float:X, Float:Y, Float:Z;
    if (DoesPlayerHaveRepairKit[playerid] == 1)
    {
      if(IsPlayerInAnyVehicle(playerid))
      {
//86            SetVehicleHealth(vehicleid, 1000.0);
            PlayerPlaySound(playerid, 1133, X, Y, Z);
            DoesPlayerHaveRepairKit[playerid] = 0;
        }
    }
    else
    {
    SendClientMessage(playerid, COLOR_RED, " You do not have a Repair kit, and/or aren't in a Vehicle !");
    PlayerPlaySound(playerid, 1084, X, Y, Z);
    }
    return 1;
    }
   
    if (strcmp("/checkrepairkit", cmdtext, true) == 0)
    {
    new Float:X, Float:Y, Float:Z;
    if(DoesPlayerHaveRepairKit[playerid] == 1)
    {
    SendClientMessage(playerid, COLOR_BLUE, " You have a Repair kit, /repairkit to use it.");
    PlayerPlaySound(playerid, 1083, X, Y, Z);
    }
    else
    {
    SendClientMessage(playerid, COLOR_RED, " You do not have a Repair kit, buy one from the Docks.");
    PlayerPlaySound(playerid, 1084, X, Y, Z);
    }
    return 1;
    }
   
    if (strcmp("/buyrepairkit", cmdtext, true) == 0)
    {
    new Float:X, Float:Y, Float:Z;
   
    if(IsPlayerConnected(playerid))
    {
        if (PlayerToPoint(2.00, playerid, 2415.6770,-2229.1726,13.5469))
            {
            if(GetPlayerMoney(playerid) >= 250)
            {
                DoesPlayerHaveRepairKit[playerid] = 1;
                GivePlayerMoney(playerid, -250);
            PlayerPlaySound(playerid, 1083, X, Y, Z);
            SendClientMessage(playerid, COLOR_BLUE, " Bought a Repair Kit, use /repairkit to Repair your Vehicle");
                }
            }
            else
            {
              SendClientMessage(playerid, COLOR_RED, " You don't have enough money, or aren't at the Docks !");
            PlayerPlaySound(playerid, 1084, X, Y, Z);
            }
        }
    }
    return 1;
    }
//140   return 0;
}
I know why this is happening. I just need to know how to fix it & make it work. I can usually just place /**/ over the return 0; (that works although I'm pretty sure you're meant to return 0 but the vehicleid isn't in
Код:
public OnPlayerCommandText(playerid, cmdtext[])
How do I make it work in the command?
Reply
#2

new vehicleid = GetPlayerVehicleID(playerid);

and it appears you have an extra bracket on line 137 or what have you, i may be wrong, but im pretty sure
Reply
#3

Cheers buddy.
Reply
#4

that was a fast reply. I wanted to help but woke up too late ;/ ;d
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)