Need Help With Custom Number Plates
#1

I am a noob when it comes to new stuff like this! So sorry for such a nooby question! But anyways... does anyone have any idea how to make a command so they type /numplate [whatever they want]

Help would be really appreciated!!
Reply
#2

pawn Код:
#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(plate, 5, cmdtext);
    return 0;
}
dcmd_plate(playerid, params[])
{
    if(!IsPlayerInAnyVehicle(playerid)){
        SendClientMessage(playerid, 0x999999AA, "You are not in a vehicle");
        return 1;
    }else{
        SetVehicleNumberPlate(GetPlayerVehicleID(playerid), params);
    }
    return 1;
}
I don't know whether this works as I just wrote it up, however it should work
Reply
#3

pawn Код:
stock
    setVehicleNumberPlate ( vehicleid, numberplate [ ] )
{
    new
        Float:vX,
        Float:vY,
        Float:vZ,
        Float:vA,
        Float:vH,
        vPanels,
        vDoors,
        vLights,
        vTires,
        vEngine,
        vLight,
        vAlarm,
        vDoor,
        vBonnet,
        vBoot,
        vObjective
    ;

    GetVehicleHealth            ( vehicleid, vH );
    GetVehicleDamageStatus      ( vehicleid, vPanels, vDoors, vLights, vTires );
    GetVehicleParamsEx          ( vehicleid, vEngine, vLight, vAlarm, vDoor, vBonnet, vBoot, vObjective );
    GetVehiclePos               ( vehicleid, vX, vY, vZ );
    GetVehicleZAngle            ( vehicleid, vA );
    SetVehicleNumberPlate       ( vehicleid, numberplate );

    printf ( "%d | %d | %d | %d", vPanels, vDoors, vLights, vTires );
    SetVehicleToRespawn         ( vehicleid );

    SetVehicleHealth            ( vehicleid, vH );
    UpdateVehicleDamageStatus   ( vehicleid, vPanels, vDoors, vLights, vTires );
    SetVehicleParamsEx          ( vehicleid, vEngine, vLight, vAlarm, vDoor, vBonnet, vBoot, vObjective );
    SetVehiclePos               ( vehicleid, vX, vY, vZ );
    SetVehicleZAngle            ( vehicleid, vA );
    return 1;
}
pawn Код:
COMMAND:vnp( playerid, params [ ] )
{
    setVehicleNumberPlate ( GetPlayerVehicleID ( playerid ), params );
    return 1;
}
Reply
#4

Quote:
Originally Posted by Retardedwolf
Посмотреть сообщение
pawn Код:
stock
    setVehicleNumberPlate ( vehicleid, numberplate [ ] )
{
    new
        Float:vX,
        Float:vY,
        Float:vZ,
        Float:vA,
        Float:vH,
        vPanels,
        vDoors,
        vLights,
        vTires,
        vEngine,
        vLight,
        vAlarm,
        vDoor,
        vBonnet,
        vBoot,
        vObjective
    ;

    GetVehicleHealth            ( vehicleid, vH );
    GetVehicleDamageStatus      ( vehicleid, vPanels, vDoors, vLights, vTires );
    GetVehicleParamsEx          ( vehicleid, vEngine, vLight, vAlarm, vDoor, vBonnet, vBoot, vObjective );
    GetVehiclePos               ( vehicleid, vX, vY, vZ );
    GetVehicleZAngle            ( vehicleid, vA );
    SetVehicleNumberPlate       ( vehicleid, numberplate );

    printf ( "%d | %d | %d | %d", vPanels, vDoors, vLights, vTires );
    SetVehicleToRespawn         ( vehicleid );

    SetVehicleHealth            ( vehicleid, vH );
    UpdateVehicleDamageStatus   ( vehicleid, vPanels, vDoors, vLights, vTires );
    SetVehicleParamsEx          ( vehicleid, vEngine, vLight, vAlarm, vDoor, vBonnet, vBoot, vObjective );
    SetVehiclePos               ( vehicleid, vX, vY, vZ );
    SetVehicleZAngle            ( vehicleid, vA );
    return 1;
}
pawn Код:
COMMAND:vnp( playerid, params [ ] )
{
    setVehicleNumberPlate ( GetPlayerVehicleID ( playerid ), params );
    return 1;
}
Dude, is there an inc thats needed with that?? it gave me this

Код:
C:\Users\Jack\Desktop\samp\filterscripts\plate.pwn(69) : error 017: undefined symbol "params"
C:\Users\Jack\Desktop\samp\filterscripts\plate.pwn(70) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)