SA-MP Forums Archive
Server vehicle system not working correctly. - 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: Server vehicle system not working correctly. (/showthread.php?tid=521328)



Server vehicle system not working correctly. - BleverCastard - 22.06.2014

I've made a vehicle system where you can select whether it's a Rental, Faction vehicle or a Job vehicle.
However, when you enter the vehicle, nothing comes up. This is my code
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
    {
        new veh = GetPlayerVehicleID(playerid);
        if(RentalInfo[veh][isJob] >= 1)
        {
            if(PlayerInfo[playerid][JobID] == RentalInfo[veh][isJob])
            {
                SendClientMessage(playerid, COLOR_GREEN, "The company you work for owns this vehicle!");
            }
            else
            {
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, COLOR_ORANGE, "You don't have the keys!");
            }
        }
        if(RentalInfo[veh][isRental] >= 1)
        {
            ShowPlayerDialog(playerid, DIALOG_RENTAL, DIALOG_STYLE_MSGBOX, "Rental", ""COL_WHITE"This vehicle is available to rent for "COLGREEN"$200."COL_WHITE"\nDo you wish to rent this vehicle?", "Rent", "Cancel");
        }
    }
    return true;
}



Re : Server vehicle system not working correctly. - Clad - 22.06.2014

Get your own help from this


Re: Server vehicle system not working correctly. - BleverCastard - 22.06.2014

Lol, not even. Did you read the post above? Stop trying to be smart, if you've got nothing good to write, don't write it.


Re: Server vehicle system not working correctly. - Clad - 22.06.2014

Quote:
Originally Posted by BleverCastard
Посмотреть сообщение
Lol, not even. Did you read the post above? Stop trying to be smart, if you've got nothing good to write, don't write it.
Yes I did, The wiki gives you an idea about how you do it, or you was expecting that I give you а full code and you copy paste ?


Re: Server vehicle system not working correctly. - BleverCastard - 22.06.2014

Oi, smartass, you clearly didn't.
pawn Код:
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
This isn't what I was asking about.