SA-MP Forums Archive
how to make a vehicle for VIP - 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)
+--- Thread: how to make a vehicle for VIP (/showthread.php?tid=419073)



how to make a vehicle for VIP - Broker - 27.02.2013

hello guys.. how to make a vehicle for VIP.. the vehicle can ride just for VIP.. like on NGRP script.. how to make it ?


Re: how to make a vehicle for VIP - DaRk_RaiN - 27.02.2013

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
    new vehicleid = GetPlayerVehicleID(playerid);
    if(PlayerInfo[playerid][vip] == 0)//Make this suitable to your script.
    {
        SendClientMessage(playerid, COLOR_RED, "You need To be a VIP to ride this vehicle.");
        RemovePlayerFromVehicle(playerid);
    }
    return 1;
}



Re: how to make a vehicle for VIP - RajatPawar - 27.02.2013

Yes, you can do the above, or just create a specific VIP vehicle by either:
pawn Код:
1) new VIPVehicle = AddStaticVehicle (...);
OR
pawn Код:
2) OnPlayerStateChange (...) { if(GetVehicleModel(..) == 411 //Infernus }



Re: how to make a vehicle for VIP - Da_Noob - 27.02.2013

Quote:
Originally Posted by DaRk_RaiN
Посмотреть сообщение
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
    new vehicleid = GetPlayerVehicleID(playerid);
    if(PlayerInfo[playerid][vip] == 0)//Make this suitable to your script.
    {
        SendClientMessage(playerid, COLOR_RED, "You need To be a VIP to ride this vehicle.");
        RemovePlayerFromVehicle(playerid);
    }
    return 1;
}
This would work but I prefer OnPlayerEnterVehicle as its called before the player is in the car.


Re: how to make a vehicle for VIP - Riddick94 - 27.02.2013

Quote:
Originally Posted by Da_Noob
Посмотреть сообщение
This would work but I prefer OnPlayerEnterVehicle as its called before the player is in the car.
It's not for you but for the creator of this topic. What is the point of your post? (and mine)


Re: how to make a vehicle for VIP - RajatPawar - 27.02.2013

OnPlayerStateChange is the best, since .. Well let me explain: you create textdraws and show them, under both the callbacks. When you press enter, I.e. When you start entering the car, the onplayerenterveh callback would be called, showing the textdraws, while opstatechange tds would be shown when the player actually sits in it. So if you use entervehicle, with removefromvehicle, it's kind of useless. I experienced this. Anyone else?


Re: how to make a vehicle for VIP - Glad2BeHere - 27.02.2013

My Vip System should help you......
It Has Everything... Also u r free to extract code from it to help urself

https://sampforum.blast.hk/showthread.php?tid=416708