Gang System Help
#1

Hey samp forum, i want to make a system for my gang's like if the player is an official member of "Grove" he can drive grove street car's if not he can't and i need an /makeleader cmd and an /invite and /gkick to kick the member out of the gang..

I define my gangs like this:

pawn Код:
public SetPlayerTeamFromClass(playerid, classid)
{
    switch(classid)
    {
         case 0:
         {
             gTeam[playerid] = Grove;
             SetPlayerPos(playerid,2520.2805,-1661.7422,14.4388);
             SetPlayerCameraPos(playerid, 2518.0984,-1662.1184,14.2107);
             SetPlayerCameraLookAt(playerid,2520.2805,-1661.7422,14.4388);
             SetPlayerFacingAngle(playerid,94.8389);
             GameTextForPlayer(playerid, "~y~Grove Street Families", 3000, 5);
         }
         case 1..2:
         {
             gTeam[playerid] = Seville;
             SetPlayerPos(playerid,2765.3560,-2012.0973,13.5620);
             SetPlayerCameraPos(playerid,2768.0066,-2012.0149,13.5547);
             SetPlayerCameraLookAt(playerid,2765.3560,-2012.0973,13.5620);
             SetPlayerFacingAngle(playerid,269.3739);
             GameTextForPlayer(playerid, "~y~Seville Boulevard Families", 3000, 5);
         }
Is it possible to make it with an enum? or something? I'm new to scripting and dont know much about that.. Can you help me ?
Reply
#2

Example of /invite and /gkick
pawn Код:
COMMAND:invite(playerid,params[])
{
new id,team;
if(sscanf(params,"ii",id,team)) return 1;
{
if(IsPlayerConnected(id)) return 1;
{
switch(team)
{
case 0: gTeam[id] = Grove;
case 1: gTeam[id] = Seville;
}
}
}
return 1;
}


COMMAND:gkick(playerid,params[])
{
new id;
if(sscanf(params,"i",id)) return 1;
{
if(IsPlayerConnected(id)) return 1;
{
gTeam[id] = Default;
}
}
return 1;
}
Reply
#3

Thanks, but i thougt about something like that:

I do /makeleader and the player's gang id changed for example to 1 = Grove, 0 = Normal player and then he is able to drive the gang cars and /invite and /gkick player's but only the leader can do /invite and /gkick Someone can help me with that?
Reply
#4

Create an enum with variable gLeader //Gang Leader - And Save it on PlayerFile and use if(gTeam[playerid] == gLeader).
Reply
#5

Can you give me an example?
Reply
#6

Can someone help me with that?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)