SA-MP Forums Archive
Number plate help - 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: Number plate help (/showthread.php?tid=69191)



Number plate help - friped93 - 16.03.2009

1. Ive searched after fixes but cant find any

Hello, Ive created a command that gives the car a new plate on gamemode start but when that car respawn or breake after that it has a normal plate and not the special plate it has.

please help me.


Код:
 cid = AddStaticVehicle(modelid,spawnX,spawnY,spawnZ,spawnA,Color1,Color2);
    SetVehicleNumberPlate(cid,plate);
    SetVehicleToRespawn(cid);
The code i got to change plate in the addcar script ive made


Re: Number plate help - [RP]Rav - 16.03.2009

Vehicles don't respawn unless a player has been in them


Re: Number plate help - friped93 - 16.03.2009

Quote:
Originally Posted by Rav
Vehicles don't respawn unless a player has been in them
-.-'' that wsnt event a help i need help how the cars shall keep the plate when they get destroyed -.-''


Re: Number plate help - Rks25 - 16.03.2009

search for this one, tip:OnVehicleSpawn.


Re: Number plate help - friped93 - 17.03.2009

Quote:
Originally Posted by Rks_
search for this one, tip:OnVehicleSpawn.
ty worked but now i got an porblem more =(


Код:
SetVehicleNumberPlate(vehicleid,cInfo[vehicleid][Plate]);
  SetVehicleToRespawn(vehicleid);
  SetVehiclePos(vehicleid,cInfo[vehicleid][SpawnX],cInfo[vehicleid][SpawnY],cInfo[vehicleid][SpawnZ]);
  SetVehicleZAngle(vehicleid,cInfo[vehicleid][SpawnR]);
it does the Setpos 1 and then respawn it so it wont go to the pos it shull go to =(


Re: Number plate help - Dujma - 17.03.2009

Quote:
Originally Posted by | Friped |
Quote:
Originally Posted by Rks_
search for this one, tip:OnVehicleSpawn.
ty worked but now i got an porblem more =(


Код:
SetVehicleNumberPlate(vehicleid,cInfo[vehicleid][Plate]);
  SetVehicleToRespawn(vehicleid);
  SetVehiclePos(vehicleid,cInfo[vehicleid][SpawnX],cInfo[vehicleid][SpawnY],cInfo[vehicleid][SpawnZ]);
  SetVehicleZAngle(vehicleid,cInfo[vehicleid][SpawnR]);
it does the Setpos 1 and then respawn it so it wont go to the pos it shull go to =(
You need to use that with timer under OnVehicleSpawn


Re: Number plate help - friped93 - 17.03.2009

Quote:
Originally Posted by Dujma
Quote:
Originally Posted by | Friped |
Quote:
Originally Posted by Rks_
search for this one, tip:OnVehicleSpawn.
ty worked but now i got an porblem more =(


Код:
SetVehicleNumberPlate(vehicleid,cInfo[vehicleid][Plate]);
  SetVehicleToRespawn(vehicleid);
  SetVehiclePos(vehicleid,cInfo[vehicleid][SpawnX],cInfo[vehicleid][SpawnY],cInfo[vehicleid][SpawnZ]);
  SetVehicleZAngle(vehicleid,cInfo[vehicleid][SpawnR]);
it does the Setpos 1 and then respawn it so it wont go to the pos it shull go to =(
You need to use that with timer under OnVehicleSpawn
ok? ive tried that but didnt get it to work can you help me then?


Re: Number plate help - _TeRmiNaToR_ - 17.03.2009

SetTimer(".", time, repeating);


Re: Number plate help - _TeRmiNaToR_ - 17.03.2009

Use this:

pawn Код:
SetVehicleNumberPlate(vehicleid,cInfo[vehicleid][Plate]);
SetTimer("SetPlate", 1000, false);
pawn Код:
forward SetPlate(vehicleid);
public SetPlate(vehicle id)
{
  SetVehicleToRespawn(vehicleid);
  SetVehiclePos(vehicleid,cInfo[vehicleid][SpawnX],cInfo[vehicleid][SpawnY],cInfo[vehicleid][SpawnZ]);
  SetVehicleZAngle(vehicleid,cInfo[vehicleid][SpawnR]);

}



Re: Number plate help - friped93 - 17.03.2009

Quote:
Originally Posted by _TeRmiNaToR_
Use this:

pawn Код:
SetVehicleNumberPlate(vehicleid,cInfo[vehicleid][Plate]);
SetTimer("SetPlate", 1000, false);
pawn Код:
forward SetPlate(vehicleid);
public SetPlate(vehicle id)
{
  SetVehicleToRespawn(vehicleid);
  SetVehiclePos(vehicleid,cInfo[vehicleid][SpawnX],cInfo[vehicleid][SpawnY],cInfo[vehicleid][SpawnZ]);
  SetVehicleZAngle(vehicleid,cInfo[vehicleid][SpawnR]);

}
Spawns on wrong posistion still becouse it wont even be placed at the pos