Need Help with Teams
#1

Hi all, I'm editing SFTDM and I'd like to know how to make a join crew command.
Here's what I've got so far.

pawn Код:
if(strcmp(cmd, "/joingroove", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
            if(AccountInfo[playerid][pFaction] != TEAM_NOTHING) return SendClientMessage(playerid, COLOR_ORANGE, "You are in another faction, exit it to join groove !");
            {
              if (PlayerToPoint(8.0, playerid, 1542.9487,-1682.6167,13.5555))
                {
                AccountInfo[playerid][pFaction] = TEAM_GROOVE;
                SendClientMessage(playerid, COLOR_ORANGE, "congrats ! you're now in Groove family !!!");
                return 1;
                }
I would like when player types /joingroove it'll set it in his file that he's TEAM_GROOVE now

I know this command will not work, don't tell me that. But I would like to know how to make it working ? Like I don't really know which things should I edit etc.Please help me.
I've defined : TEAM_NOTHING 0, TEAM_GROOVE 1 and yes I have a saving account system.
Reply
#2

*BUMP* Anyone ? Please...
Reply
#3

Help please, would you fix that code for me ?? please...
Reply
#4

Thats basically It, But after you have set the Team with AccoutnInfo[playerid][pFaction], Paste the line which you use to save a players Team undernearth it. You should know what yoru Team saving line is since you have your own Save system.

pawn Код:
if(strcmp(cmd, "/joingroove", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(AccountInfo[playerid][pFaction] != TEAM_NOTHING) return SendClientMessage(playerid, COLOR_ORANGE, "You are in another faction, exit it to join groove !");
            {
                if (PlayerToPoint(8.0, playerid, 1542.9487,-1682.6167,13.5555))
                {
                    AccountInfo[playerid][pFaction] = TEAM_GROOVE;
                    SendClientMessage(playerid, COLOR_ORANGE, "congrats ! you're now in Groove family !!!");
                    //Put the Team saving Line Here
                }
            }
        }
        return 1;
    }
Reply
#5

Alright I tried that, here's the code

pawn Код:
if(strcmp(cmd, "/joingroove", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(AccountInfo[playerid][pFaction] != TEAM_NOTHING) return SendClientMessage(playerid, COLOR_ORANGE, "You are in another faction, exit it to join groove !");
            {
                if (PlayerToPoint(8.0, playerid, 1542.9487,-1682.6167,13.5555))
                {
                    AccountInfo[playerid][pFaction] = TEAM_GROOVE;
                    SendClientMessage(playerid, COLOR_ORANGE, "congrats ! you're now in Groove family !!!");
                    format(var, 32, "Faction=TEAM_GROOVE\n",AccountInfo[playerid][pFaction]);fwrite(hFile, var);
                }
            }
        }
        return 1;
    }
But the problem is when I type this command, my server crashes, anyone know why is that ? please help.
Reply
#6

Are you having the file you are writing the data to in the correct folder?
Reply
#7

Quote:
Originally Posted by DJDhan
Are you having the file you are writing the data to in the correct folder?
Yes I do
Reply
#8

Any warnings while compiling your script?
Do you have other gangs aswell?And can you join them without problems?
Reply
#9

Quote:
Originally Posted by DJDhan
Any warnings while compiling your script?
Do you have other gangs aswell?And can you join them without problems?
No i don't get any errors/warnings, and yes i've other gangs, but I haven't made any command to join them yet. I was going to make other commands based on this one. But as I see noone can't help me
Reply
#10

Can you tell me what the fuck is wrong with this ? come on you guys ? please I can't work on it, i'm trying to fix it by myself but I fail and im getting fuckin angry right now...FUCK !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)