Checkpoint/car [i can't put a precise way] - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Checkpoint/car [i can't put a precise way] (
/showthread.php?tid=176786)
Checkpoint/car [i can't put a precise way] -
SmartCop - 14.09.2010
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 !
Re: Checkpoint/car [i can't put a precise way] -
legodude - 14.09.2010
****** 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;
}
Re: Checkpoint/car [i can't put a precise way] -
SmartCop - 15.09.2010
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)
Re: Checkpoint/car [i can't put a precise way] -
Voldemort - 15.09.2010
legodudem already helped you
pawn Код:
public OnGameModeInit()
{
rentveh[0]= AddStaticVeh(Yourcar
rentveh[1]= AddStaticVeh(....
...
//and so on.
return 1;
}