how can i do this - 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: how can i do this (
/showthread.php?tid=371642)
how can i do this -
ZBits - 24.08.2012
i have vehicles in my gamemodes
now what i want to do is When a player enters a Vehcile the Fuction SendClientMessage is called
as it sends a player messag "You Entered a : vehname Owner: state"
Thanks if anyone helps
Re: how can i do this -
Lordzy - 24.08.2012
If im not wrong,try this:
pawn Код:
public OnVehicleEnter//some thing like that
{
//message
return 1;
}
//Or
public OnPlayerKeyChange//some thing like this
{
//You've to find player changes to driver.
// Then the message
return 1;
}
Im sorry for this type of solution .
I couldnt say completly because I stopped scripting since 5.3 months and im using forums through mobile.
Re: how can i do this -
ZBits - 24.08.2012
i know how to do it but i cannot simply type all the Vehicles one by one
Respuesta: how can i do this -
[DOG]irinel1996 - 24.08.2012
May you tell me your vehicle variables, I must know owner variable.
Re: how can i do this -
ZBits - 24.08.2012
i dont want the Owner thing only it should just say Owner: state that means the state owns it i want all vehicles to say Owner: state
Respuesta: how can i do this -
[DOG]irinel1996 - 24.08.2012
Aaaa... Ok, but you must have a variable which stores that state. Have you?
Re: how can i do this -
ZBits - 24.08.2012
Umm you dint get me
IT Just need to send a Message You Entered : vehname Owner: State
Leave the State as it is i dont want like LV or LS just State
Re: how can i do this -
Lordzy - 24.08.2012
Try this
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER) // Player entered a vehicle as a driver
{
new vehicleid = GetPlayerVehicleID(playerid);
//message here
}
return 1;
}
Re: how can i do this -
ZBits - 24.08.2012
same thing i need to type one by one like
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER) // Player entered a vehicle as a driver
{
new vehicleid = GetPlayerVehicleID(playerid);
if(vehicleid > 1 )
{
SendClientMessage)plsyerid,-1,"You entred a : Buffalo OWner State");
}//and so on
}
return 1;
}
Re: how can i do this -
castlecity - 24.08.2012
Forum pm me all the details and ill script it in for you, if you need scripting help ill temp script for you.