Team Car Jack -
MidoTheHawk - 04.06.2009
Hello..
I'm trying to make an Anti-TJ, but it seems that i'm failing, anyone could help mehh?? :/
gTeam = TEAM_ARMY
Thanks
Re: Team Car Jack -
hoodline - 04.06.2009
pawn Код:
new gTeam[MAX_PLAYERS];
gTeam[playerid] == TEAM;
Re: Team Car Jack -
samgreen - 04.06.2009
Quote:
Originally Posted by hoodline
pawn Код:
new gTeam[MAX_PLAYERS];
gTeam[playerid] == TEAM;
|
I'm sorry, I don't understand what the point is in posting these useless responses. I see people all over the forums providing minimal code with no description for small problems like these. Do you honestly think what you posted is helpful? If you would have taken the time to post a thoughtful response, the question could have already been answered. Stop wasting your time and ours.
Quote:
Originally Posted by MidoTheHawk
Hello..
I'm trying to make an Anti-TJ, but it seems that i'm failing, anyone could help mehh?? :/
gTeam = TEAM_ARMY
Thanks 
|
To clarify, you are asking how you would prevent members on the same team from car jacking each other, is that correct?
Re: Team Car Jack -
MidoTheHawk - 05.06.2009
@ samgreen: Yes
@ Hood: What? ?? :/, Hello BTW
Re: Team Car Jack -
efeX - 05.06.2009
-snip- nevermind, i overreacted.
Re: Team Car Jack -
BMUK - 05.06.2009
Quote:
Originally Posted by efeX
Do you expect us to post exact code?
As far as i know this section isn't "Post question get full code"
If you can't figure out how to incorporate small examples into your code, then you shouldn't be trying things like that and should be learning more basics...
We aren't going to spoonfeed everyone.
|
Its A SCRIPTING DISCUSSION board. Ya'know where people get help with scripting?
He didnt ask for full, exact and working code, he just needs some pointers..
Dick
Re: Team Car Jack -
efeX - 05.06.2009
I already said nevermind, sorry.
Anyways.... Most topics here say "I want to do ....." how?
You explain they say "how?"
That sounds like asking for code to me. I know it's discussion. sorry.
Re: Team Car Jack -
samgreen - 05.06.2009
Most people will learn from examples, especially if they have struggled with the problem themselves for a bit. I always offer as much explanation as I can to the posts I write.
I understand your frustration in this being a scripting discussion board with few discussion topics (****** has made some fantastic ones), and many "How do I..." topics. If we teach each other when we have problems, we can excel as a community. We're all on the same team here.
On that note, I am not sure if you can stop them from car jacking, but you can definitely remove them after (and possibly punish them?). I'm not sure how this code will run, as
a_samp.inc says
PLAYER_STATE_ENTER_VEHICLE_DRIVER is "used internally".
pawn Код:
OnPlayerStateChange(playerid, newstate, oldstate) {
if(newstate == PLAYER_STATE_ENTER_VEHICLE_DRIVER && oldstate == PLAYER_STATE_ONFOOT) {
// Player is entering a vehicle?
} else if(newstate == PLAYER_STATE_DRIVER) {
// Player has entered a vehicle
}
return 1;
}
Re: Team Car Jack -
BMUK - 05.06.2009
Probably would be best to use
OnPlayerEnterVehicle instead as
OnPlayerStateChange works after you actually sit in the vehicle
after chucking your team mate out the drivers seat lol
Midolina this is what ya cud do in
OnPlayerEnterVehicle
1) Check if the player entering is army
2) Check if the vehicle already has a driver
3) Check if the driver is also army
4) Punnish
All easy shizzle
Re: Team Car Jack -
lol2112 - 05.06.2009
Quote:
I am not sure if you can stop them from car jacking
|
Of course you can stop them.
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
new vehicleid = GetPlayerVehicleID(playerid);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(gTeam[i] == gTeam[playerid])
{
SetVehicleParamsForPlayer(vehicleid, i, 0, 1); //locks the car for anyone on the team of the player entering the car.
}
}
}
else if(newstate == PLAYER_STATE_EXIT_VEHICLE)
{
new vehicleid = GetPlayerVehicleID(playerid);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(gTeam[i] == gTeam[playerid])
{
SetVehicleParamsForPlayer(vehicleid, i, 0, 0);//unlocks the car for anyone on the team of the player entering the car.
}
}
}
return 1;
}
I'm not 100% sure that
Код:
new vehicleid = GetPlayerVehicleID(playerid);
will work if the newstate of the player is exitting his vehicle but try it...