Little help About groups. - 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: Little help About groups. (
/showthread.php?tid=620199)
Little help About groups. -
ThatFag - 27.10.2016
Hello there.
Im trying to create a group system with co operation which means something like alliances.
A player can create a group and also join an cooperation the problem is that i need some help with this.
I dont know how to make for example how to save the cooperation name or id idk, then from that cooperation get if the group is cooperation 1 or the id.
do i have to store an id of cooperation for example Group "ThatFag1" and Group "ThatFag2" are in a cooperation so they will be able to see eachothers frequences - but i know how to save the freqs but not in same cooperation id.someonehelp pls
srry for my bad english.
Re: Little help About groups. -
Dignity - 27.10.2016
So, if I understood the thread, you want people in the same alliance to be on the same "frequency"? For that, you could do something like this:
PHP код:
new Group_Name [ MAX_PLAYERS ] [ MAX_PLAYER_NAME ] ;
new Alliance_ID [ MAX_PLAYERS char ] ;
SharedFrequency ( playerid, text [ ] ) {
new string [ 256 ] ;
// Loop through players
foreach (new i: Player) {
// If the alliance ID matches that with another player...
if ( Alliance_ID { playerid } == Alliance_ID { i } ) {
// Format the text to be sent to them showing the group name and text
format ( string, sizeof ( string ), "[%s]: %s ", Group_Name [ playerid ], text);
SendClientMessage ( i, -1, string ) ; // And send it
}
}
return true ;
}
Re: Little help About groups. -
HoangNam - 27.10.2016
Use Dini or SQLITE
ex:
http://forum.sa-mp.com/showthread.ph...highlight=dini
http://forum.sa-mp.com/showthread.ph...highlight=dini
http://forum.sa-mp.com/showthread.ph...highlight=dini
Re: Little help About groups. -
ThatFag - 27.10.2016
Im using an mysql version of gamemode so basicly thats why it is hard for me to do this.
so now i have created /cooperation - create which allows an leader to create an cooperation or alliance with a name that he wants , after that he can setfrequences with /cooperationfreqs - and set the freqs he wants but now what the problem is that i dont know how to get his alliance and the frequences that he've setted.
do i have to create an id everytiime an leader creates an alliance then from ID get freqs and other group allies name ?
Re: Little help About groups. -
Dignity - 27.10.2016
Quote:
Originally Posted by ThatFag
Im using an mysql version of gamemode so basicly thats why it is hard for me to do this.
so now i have created /cooperation - create which allows an leader to create an cooperation or alliance with a name that he wants , after that he can setfrequences with /cooperationfreqs - and set the freqs he wants but now what the problem is that i dont know how to get his alliance and the frequences that he've setted.
do i have to create an id everytiime an leader creates an alliance then from ID get freqs and other group allies name ?
|
Use arrays.
https://sampwiki.blast.hk/wiki/Scripting_Basics#Arrays
https://sampwiki.blast.hk/wiki/Advanced_Structures