Need Help with Teams -
*BueNoOo* - 04.12.2009
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.
Re: Need Help with Teams -
*BueNoOo* - 04.12.2009
*BUMP* Anyone ? Please...
Re: Need Help with Teams -
*BueNoOo* - 05.12.2009
Help please, would you fix that code for me ??
please...
Re: Need Help with Teams -
miokie - 05.12.2009
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;
}
Re: Need Help with Teams -
*BueNoOo* - 05.12.2009
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.
Re: Need Help with Teams -
DJDhan - 05.12.2009
Are you having the file you are writing the data to in the correct folder?
Re: Need Help with Teams -
*BueNoOo* - 05.12.2009
Quote:
Originally Posted by DJDhan
Are you having the file you are writing the data to in the correct folder?
|
Yes I do
Re: Need Help with Teams -
DJDhan - 05.12.2009
Any warnings while compiling your script?
Do you have other gangs aswell?And can you join them without problems?
Re: Need Help with Teams -
*BueNoOo* - 05.12.2009
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
Re: Need Help with Teams -
*BueNoOo* - 05.12.2009
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 !