Need Help With Custom Number Plates - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need Help With Custom Number Plates (
/showthread.php?tid=206860)
Need Help With Custom Number Plates -
Jack_Rocker - 04.01.2011
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!!
Re: Need Help With Custom Number Plates -
Sascha - 04.01.2011
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
Re: Need Help With Custom Number Plates -
Retardedwolf - 04.01.2011
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;
}
Re: Need Help With Custom Number Plates -
Jack_Rocker - 04.01.2011
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.