*** Terrible Title Removed
#1

Hey buddys!

little problem, I know, itґs a stupid topic but, I dont know, what I do wrong!
Iґm sorry, if I write too much in "Scripting Help", but I want to finish my CarHouseSystem.

Here is the stupid error(sorry for this word)
PHP Code:
Line (341): The number of parameters is incorrect 
And the code:

PHP Code:
public OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
    for(new 
0sizeof(grotticars); i++)
    {
    if(
OnPlayerEnterVehicle(playeridvehicleid) == grotticars[i]) //error is here
    
{
        
TogglePlayerControllable(playeridtrue);
    }
    else
    {
    }
    } 
I have more from code, but the rest of the code does not match to this
I want, when the player is in the car, he can do nothing, so I try that. but...
THEEESE warning..
And a Question too, how you can start the pawn code?
also (php) script(/php) how do you do that?
Reply
#2

hahahahahaahhhaahahah, you can't check call back use if(vehicleid == grotticars[i]) instead of if(OnPlayerEnterVehicle(playerid, vehicleid) == grotticars[i])
Reply
#3

You dont know what I mean...
The player must be in the car, if i push f, he do nothing, he cant go into the car...
I dont know, how I write that like that, that what youґve is good, but I stay only and dont join in the car.
If I do my code, I can go into the car, but I can do nothing, that is, what I want..
Please help..
Reply
#4

yes, you need to check with vehicleid == grotticars, but if you want to get in vehicle and then freez player you can't do that in this callback, because this is called when player press F and start getting in car, you should put it in OnPlayerStateChange, and check is players state driver
Reply
#5

Ouuuuh Sorry, my mistake
Reply
#6

look, I haven't told you, when you want to check vehicles id in OnPlayerStateChange, you need to do vehicleid = GetPlayerVehicleID(playerid)

pawn Code:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
     new vehicleid;
     if(newstate == PLAYER_STATE_DRIVER){
          vehicleid = GetPlayerVehicleID(playerid);
          // and then you loop through grotti cars :D
     }
Reply
#7

Edit:
All perfect, I love you THANX ALLOT!
Reply
#8

np I'm glad I helped
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)