Little help About groups.
#1

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.
Reply
#2

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 playeridtext [ ] ) {
    new 
string 256 ] ;
    
// Loop through players
    
foreach (new iPlayer) {
        
// If the alliance ID matches that with another player...
        
if ( Alliance_ID playerid } ==  Alliance_ID } ) {
        
            
// Format the text to be sent to them showing the group name and text
            
format stringsizeof ( string ), "[%s]: %s "Group_Name playerid ], text);
            
SendClientMessage i, -1string ) ; // And send it
        
}
    }
    return 
true ;

Reply
#3

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
Reply
#4

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 ?
Reply
#5

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)