Checkpoint/car [i can't put a precise way]
#1

I'm not sure how to explain this ... but i'll try: I chose a place on my map and there i want to put some cars to rent . I put the cars on the map , but i want to do something special with that those cars. I want to do when you get in one of those cars to show you a message (i know how to do this), but i don't know to do this: When a player get in one of those cars and he will not write /rcar (rent car) to can't go by that car , and if he will /rcar to can go by that car . But this command (/rcar) i want to do to function only of those cars - i don't know to do this.

- I'll tray to understand what you'll say to me.
- If you don't understand something, ask me.
- Thankyou very much !
Reply
#2

****** translate/babelfish?

but ok lemme help.
UNTESTED!!
Код:
#include <a_samp>
new rentveh[10];
public OnGameModeInit()
{
	rentveh[0]=//veh0
	rentveh[1]=//veh1
	//and so on.
	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/rcar", cmdtext, true, 10) == 0)
	{
	    new vehicleid = GetPlayerVehicleID(playerid);
		for(new i=0;i<sizeof(rentveh);i++)
	    {
	    	if(vehicleid==rentveh[i])
	    	{
	        SendClientMessage(playerid,0xaaaaaaaa,"You Rented the car!");
	        TogglePlayerControllable(playerid,true);
	    	}
	    }
		return 1;
	}
	return 0;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	if(newstate==PLAYER_STATE_DRIVER)
	{
	    new vehicleid = GetPlayerVehicleID(playerid);
	    for(new i=0;i<sizeof(rentveh);i++)
	    {
	    	if(vehicleid==rentveh[i])
	    	{
	        SendClientMessage(playerid,0xaaaaaaaa,"This car is for rent!!");
	        TogglePlayerControllable(playerid,false);
	    	}
	    }
	}
	return 1;
}
Reply
#3

Not ****** translate. I'm not from America and i don't know english very well. Man where it just to put the vehicle coordonates ? I want only for a vehicle (my coord) to be this (rent a car)
Reply
#4

legodudem already helped you
pawn Код:
public OnGameModeInit()
{
    rentveh[0]= AddStaticVeh(Yourcar
    rentveh[1]= AddStaticVeh(....
...
    //and so on.
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)