SA-MP Forums Archive
Help on scripting using teams - 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: Help on scripting using teams (/showthread.php?tid=133434)



Help on scripting using teams - xk6adm - 12.03.2010

Hello,

I want to make an gamemode that will have 2 teams, one team will have only one member and will chase the other team formated from all other members.
When the people that is single in team will tuch other member by car to car or by foot it will be transfered to the other team and the tuched will be single in the team and will chase the other team.
How can i make this ?
How can verfy that 2 people tuch or crash with cars ?


Re: Help on scripting using teams - xk6adm - 12.03.2010

please help


Re: Help on scripting using teams - 02manchestera - 12.03.2010

not sure if this is possiable as wont each player just switch no one player ?


Re: Help on scripting using teams - Extremo - 12.03.2010

1.) This is some zombie idea right?
2.) You could check the players positions etc and if both cars lose health and are REALLY CLOSE to each other(you may assume they have crashed with each other) then you may just switch teams. This doesn't mean its impossible to bug abuse or anything, generally, I'd say its impossible to make this perfect.

You can only make it with timers, or losing health etc, but you may trigger it for another player who wasn't involved, so either way I do not assume that you are able to make this perfect.


Re: Help on scripting using teams - xk6adm - 12.03.2010

@02manchestera

I want to know when one player car touches other player car.
The gamemode that i try to make is something like that:

One player runs to touch other players
When he touch other player the touched player need to run to touch other players and so on


@[NT]Extremo

1. Yes but without weapons, only by car or motorbike touch
2. Dosen`t need to be perfect

Thanks for replying
and sorry for my bad english


Re: Help on scripting using teams - xk6adm - 12.03.2010

Here is an schematic diagram of what i want:

1. create 2 teams:

1. Only one player, the zoombie
2. People the rest of the player on servers

2. if two players positions are allmost the same and the team is different switch teams

I know php but i am an beginer at pawn.

Any help or ideea is welcome.
thank you for replaying
PS: its like tig game


Re: Help on scripting using teams - xk6adm - 13.03.2010

Please help with any ideea


Re: Help on scripting using teams - xk6adm - 13.03.2010

I found the following functions:
GetDistanceBetweenVehicles(vehicleid, vehicleid2);

Код:
stock GetDistanceBetweenVehicles(vehicleid, vehicleid2)
{
new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
new Float:tmpdis;
GetVehiclePos(vehicleid,x1,y1,z1);
GetVehiclePos(vehicleid2,x2,y2,z2);
tmpdis = floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
return floatround(tmpdis);
}
GetDistanceBetweenPlayers(playerid, playerid2)

Код:
stock GetDistanceBetweenPlayers(playerid, playerid2)
{
new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
new Float:tmpdis;
GetPlayerPos(playerid,x1,y1,z1);
GetPlayerPos(playerid2,x2,y2,z2);
tmpdis = floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
return floatround(tmpdis);
}
How i can use it in my problem ?


Re: Help on scripting using teams - xk6adm - 14.03.2010

please help, i can help you to whit web hosting or php scripts


Re: Help on scripting using teams - xk6adm - 14.03.2010

help please