Vehicle Number Plates - Random OnVehicleSpawn
#1

Hey Guys!

I've been working on my script and now i'm wondering if it's possible to give every car a Certain NumberPlate, for example every numberplate will start off with: "NGRP", then the last 3 letters would be random, i've tried it with just Army Cars, but it doesn't seem to set the numberplate, here's my code.

pawn Код:
public OnVehicleSpawn(vehicleid)
{
    new string[56];
    if(vehicleid >= 1 && vehicleid <= 9)
    {
        new randnumb = 1 + random(9);
      format(string, sizeof(string),"NGRP %d%d%d",randnumb,randnumb,randnumb);
      SetVehicleNumberPlate(vehicleid, string);
    }
    return 1;
}
but the vehicle numberplate just wont change, any ideas? Thanks.


(( Nevermind SetVehicleNumberPlate has been removed, thanks though. ))
Reply
#2

i don't know, but nice
Reply
#3

@wolfcock, nice 10 months bump.

@Mike, if you still play SAMP, You need to respawn the vehicle.
Reply
#4

Rofl, really made me laugh this 10 months bump XD
Reply
#5

Jizz. Nice bump haha. For some other reason I felt to restate what he said.

You have to respawn the vehicle, when calling it under OnVehicleSpawn().
pawn Код:
public OnVehicleSpawn(vehicleid)
{
    new string[32];
    if(vehicleid >= 1 && vehicleid <= 9)
    {
        new randnumb = 1 + random(9);
        format(string, sizeof(string),"NGRP %d%d%d",randnumb,randnumb,randnumb);
        SetVehicleNumberPlate(vehicleid, string);
        SetVehicleToRespawn(vehicleid);
    }
    return 1;
}
Reply
#6

Lol. Why bumping this so hard?

And. I thought that the licenseplate didn't work anymore?
Reply
#7

Quote:
Originally Posted by bartje01
Посмотреть сообщение
Lol. Why bumping this so hard?

And. I thought that the licenseplate didn't work anymore?
No other thread to reply on atm. (jking, have no idea).

Plates seems to work fine for me.
Reply
#8

not for me
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)