Quick command help needed. [/fixveh]
#1

pawn Код:
if (strcmp("/fv", cmdtext, true, 10) == 0)
    {
        new VehicleID = GetPlayerVehicleID(playerid);
        RepairVehicle(VehicleID);
        SetVehicleHealth(VehicleID, 1000);
        IsPlayerInVehicle(playerid, vehicleid);
        SendClientMessage(playerid,COLOR_NAVY,"VEHICLE: Your vehicle has been fully repaired.");
        else SendClientMessage(playerid,COLOR_NAVY,"VEHICLE: You must be in a vehicle to repair.");
        return 1;
    }
Код:
C:\Users\Kyle\Desktop\SAMP RP USE THIS!\gamemodes\testserver.pwn(274) : error 017: undefined symbol "vehicleid"
C:\Users\Kyle\Desktop\SAMP RP USE THIS!\gamemodes\testserver.pwn(276) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
What I want to do is to be able to have it so if you are in a vehicle it says "Your vehicle has been fully repaired" and if your not in a vehicle it says "You must be in a vehicle to repair. I want it to work for every vehicle, not just enter one vehicle ID.

Yes i'm noobish, this is my second day scripting.
Reply
#2

Monky fix, good now, happy be

pawn Код:
if (strcmp("/fv", cmdtext, true, 10) == 0)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            RepairVehicle(GetPlayerVehicleID(playerid));
            SendClientMessage(playerid,0x008080FF,"VEHICLE: Your vehicle has been fully repaired.");
        }
        else SendClientMessage(playerid,0x008080FF,"VEHICLE: You must be in a vehicle to repair.");
        return 1;
    }
Reply
#3

Kyle use, works now, is happy!

Thanks alot.
Reply
#4

Код:
if (strcmp("/fv", cmdtext, true, 10) == 0)
     {
           new VehicleID = GetPlayerVehicleID(playerid);
           RepairVehicle(VehicleID);
           SetVehicleHealth(VehicleID, 1000);
           IsPlayerInVehicle(playerid, vehicleid); // heres the error.
           SendClientMessage(playerid,COLOR_NAVY,"VEHICLE: Your vehicle has been fully repaired.");
           else SendClientMessage(playerid,COLOR_NAVY,"VEHICLE: You must be in a vehicle to repair.");
           return 1;
     }
Since Pawno is case-sensitive, you needed to type "VehicleID" because thats the one you defined, instead of vehicleid. Maybe that wasnt the only one error, im not on my laptop so i cant check
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)