SA-MP Forums Archive
How to make myself army? - 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: How to make myself army? (/showthread.php?tid=325316)



How to make myself army? - iCush - 12.03.2012

Code:
public OnPlayerSpawn(playerid)
{
    SetPlayerWantedLevel(playerid,0);
    if(gTeam[playerid] == Army)
	{
	    new file[256];
    	format(file, sizeof(file), SERVER_USER_FILE, GetName(playerid));
    	SetPlayerColor(playerid,VIOLET);
		if(dini_Int(file, "IsArmy") != 1)
		{
		    GameTextForPlayer(playerid,"~r~You Have To Be ~g~Army ~n~To Use This!",4000,1);
			ForceClassSelection(playerid); SetPlayerHealth(playerid,0.0);
		}
		/*new Rob = 0;
		new Arm = 0;
		for( new i = 0; i != MAX_PLAYERS; i++)
		{
		    if(gTeam[i] == Robbers)
		    {
		        Rob ++;
			}
			else if(gTeam[i] == Army)
		    {
		        Arm ++;
			}
		}
		if(Rob / 2 < Arm)
		{
		    GameTextForPlayer(playerid,"~r~Please Wait For More Criminals Before Becoming Army!",4000,1);
			ForceClassSelection(playerid); SetPlayerHealth(playerid,0.0);
		}*/
	}



Re: How to make myself army? - [ABK]Antonio - 12.03.2012

Edit your file and make IsArmy 1


Re: How to make myself army? - iCush - 12.03.2012

What do you mean??
if(dini_Int(file, "IsArmy 1")?


Re: How to make myself army? - [ABK]Antonio - 12.03.2012

dini_Int(file, "IsArmy") gets the info from your file then checks that value.


Re: How to make myself army? - iCush - 12.03.2012

What file


Re: How to make myself army? - [ABK]Antonio - 12.03.2012

...smack yourself

Your save file...

format(file, sizeof(file), SERVER_USER_FILE, GetName(playerid));

That means it's going to be your name, in SERVER_USER_FILE path


Re: How to make myself army? - iCush - 12.03.2012

Can you give the pawno and earse the thing u need n put
format(file, sizeof(file), SERVER_USER_FILE, GetName(playerid));


Re: How to make myself army? - admantis - 12.03.2012

You don't need to edit anything in the script, you need to edit a separate file.
I suggest you to read basic information about the Windows (if you use Windows) browser, how to open and edit text files. Or.. some common sense wouldn't come bad.


Re: How to make myself army? - iCush - 13.03.2012

Quote:
Originally Posted by [ABK]Antonio
View Post
...smack yourself

Your save file...

format(file, sizeof(file), SERVER_USER_FILE, GetName(playerid));

That means it's going to be your name, in SERVER_USER_FILE path
Please help me please =[[[[


Re: How to make myself army? - iCush - 13.03.2012

Anyone can fix this gamemode bug will get 5$
bug first 71.199.137.8:7777