Need help with Some pawn
#1

I need help to script a cmd in which I want to add IsPlayerinVehicle bu i dont know the full thing so for e.g I want to make a cmd 'test' and it only be used if the player is in a NRG (id 522) when u r in tht vehicle and u type it it displays something like i know tht sendclient mesage tht i'll do. but if tht player is not in the vehicle it will show the text 'You need to be in an NRG' and also can I add several other vehicles for this in the same cmd like i want it for infernus (id 411) and few other so plz help me !!!!!!!!
Reply
#2

pawn Код:
CMD:test(playerid, params[])
{
    if(IsPlayerInVehicle(playerid, 522))
    {
        //Do something if they are in NRG
    }
    //If they are not in NRG
    return 1;
}
And if you want to make a few vehicles get checked, use something like this stock:

pawn Код:
stock IsCertainVehicle(playerid)
{
    if(IsPlayerInVehicle(playerid, 522) || IsPlayerInVehicle(playerid, 411))
    {
        return true;
    }
    else return false;
}
Then use the stock like this:

pawn Код:
CMD:test(playerid, params[])
{
    if(IsCertainVehicle(playerid))
    {
        //If they are in NRG or Infernus
    }
    //If they are NOT in NRG or Infernus
    return 1;
}
Hope I helped.
Reply
#3

Script Request Thread
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)