Justice Scripting Questions Topic
#1

I am/you are tired of making many damn topics for new and new subjects about scripting, so I will make one which I will ask whatever I need.
I want to do these things:
When you join a gang, at in the gang house must be a room where you can take some guns. Could someone script it for me/help me?
I mean like a Police /duty.
When you join a gang, at the spawn point must be a "?" object and you have to type "/guns" and it will give you to choose what gun to choose from these:
-Deagle
-Shotgun
-Baseball Bat

Could you help me?
Reply
#2

pawn Код:
if(strcmp(cmd, "/gang", true) == 0)
    {
        GetPlayerName(playerid, sendername, sizeof(sendername));
        if(gTeam[playerid] == GANGTEAM)
        {
            SendClientMessage(playerid, COLOR_GRAD2, "You are not a gangmember.");
            return 1;
        }
        if (gTeam[playerid] == GANGTEAM)
        {
            if (PlayerToPoint(3, playerid,x,y,z)
            {
                gTeam[playerid] = GANGTEAM;
                SetPlayerToTeamColor(playerid);
                format(string, sizeof(string), "* %s Puts his guns back in the base.", sendername);
                SetPlayerWeapons(playerid);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                printf("%s", string);
                return 1;
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD2, "You are not at a gangbase.");
                return 1;
            }
        }
        if (gTeam[playerid] == GANGTEAM)
        {
            if (PlayerToPoint(3, playerid,x,y,z)
            {
                gTeam[playerid] = GANGTEAM;
                SetPlayerToTeamColor(playerid);
                {
                    format(string, sizeof(string), "* Gangleader %s Takes some guns out of the base", sendername);
                }
                else
                {
                    format(string, sizeof(string), "* Gangmember %s Takes some guns out of the base.", sendername);
                }
                SetPlayerWeapons(playerid);
            GivePlayerWeapon(playerid,28,999999);//uzi
                GivePlayerWeapon(playerid,26,999999);//sawnoff
                GivePlayerWeapon(playerid,24,999999);//deagle
                GivePlayerWeapon(playerid,31,999999);//m4
                GivePlayerWeapon(playerid,34,999999);//sniper
                GivePlayerWeapon(playerid,4,1);//knife
                SetPlayerHealth(playerid, 100.0);
                SetPlayerArmour(playerid, 100.0);
                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                printf("%s", string);
                return 1;
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD2, "You are not in the gangbase.");
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GRAD2, "You are not part of any gang.");
            return 1;
        }
        return 1;
    }
Paste it under OnPlayerCommandText.

Change GANGTEAM to the team you want.
Reply
#3

Umm, is it possible to put new graffiti tags on the walls? And writing anything else than the usual grafities of SA?
Reply
#4

Quote:
Originally Posted by [ToX
Justice ]
Umm, is it possible to put new graffiti tags on the walls? And writing anything else than the usual grafities of SA?
Nope, that isn't possible. Although there is some graffiti stuff available, done by Seif I think. Give it a search
Reply
#5

OK, I started to modify my GM, but after I did my work, I got many errors.
Because I had these errors in the past too, I known that there missed a bracket or more, so I use ScriptDebug by Sandra.
And in this code miss 2 brackets, but I can't see where I miss them:
Код:
public ShowStats(playerid,targetid)
{
  if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
	{
		new cash = GetPlayerMoney(targetid);
		new atext[20];
		if(PlayerInfo[targetid][pSex] == 1) { atext = "Male"; }
		else if(PlayerInfo[targetid][pSex] == 2) { atext = "Female"; }
 		new otext[20];
		if(PlayerInfo[targetid][pOrigin] == 1) { otext = "USA"; }
		else if(PlayerInfo[targetid][pOrigin] == 2) { otext = "Europe"; }
		else if(PlayerInfo[targetid][pOrigin] == 3) { otext = "Asia"; }
		else if(PlayerInfo[targetid][pOrigin] == 4) { otext = "Africa"; }
		new ttext[20];
		if(PlayerInfo[targetid][pMember] == 4 || PlayerInfo[targetid][pLeader] == 4) { ttext = "Medic"; }
		else if(gTeam[targetid] == 3 || gTeam[targetid] == 4) { ttext = "Civilian"; }
		else if(PlayerInfo[targetid][pMember] == 1 || PlayerInfo[targetid][pLeader] == 1) { ttext = "Police Department"; }
		else if(PlayerInfo[targetid][pMember] == 2 || PlayerInfo[targetid][pLeader] == 2) { ttext = "FBI Agent"; }
		else if(PlayerInfo[targetid][pMember] == 3 || PlayerInfo[targetid][pLeader] == 3) { ttext = "National Guard"; }
		else if(PlayerInfo[targetid][pMember] == 4 || PlayerInfo[targetid][pLeader] == 4) { ttext = "Fireman/Paramedic"; }
		else if(PlayerInfo[targetid][pMember] == 5 || PlayerInfo[targetid][pLeader] == 5) { ttext = "Sureсos"; }
		else if(PlayerInfo[targetid][pMember] == 6 || PlayerInfo[targetid][pLeader] == 6) { ttext = "Norteсos"; }
		else if(PlayerInfo[targetid][pMember] == 7 || PlayerInfo[targetid][pLeader] == 7) { ttext = "Government"; }
		else if(PlayerInfo[targetid][pMember] == 8 || PlayerInfo[targetid][pLeader] == 8) { ttext = "Hitman"; }
		else if(PlayerInfo[targetid][pMember] == 9 || PlayerInfo[targetid][pLeader] == 9) { ttext = "News Reporter"; }
		else if(PlayerInfo[targetid][pMember] == 10 || PlayerInfo[targetid][pLeader] == 10) { ttext = "Taxi Driver"; }
		else if(PlayerInfo[targetid][pMember] == 11 || PlayerInfo[targetid][pLeader] == 11) { ttext = "School Instructor"; }
		else if(PlayerInfo[targetid][pMember] == 12 || PlayerInfo[targetid][pLeader] == 12) { ttext = "Crips"; }
		else if(PlayerInfo[targetid][pMember] == 13 || PlayerInfo[targetid][pLeader] == 13) { ttext = "Bloods"; }
		else if(PlayerInfo[targetid][pMember] == 14 || PlayerInfo[targetid][pLeader] == 14) { ttext = "Latin Kings"; }
		new dtext[20];
		if(STDPlayer[targetid] == 1) { dtext = "Chlamydia"; }
		else if(STDPlayer[targetid] == 2) { dtext = "Gonorrhea"; }
		else if(STDPlayer[targetid] == 3) { dtext = "Syphilis"; }
		else { dtext = "None"; }
	  new ftext[30];
	  if(PlayerInfo[targetid][pMember] == 1 || PlayerInfo[targetid][pLeader] == 1)
		{ ftext = "Los Angeles Police Department"; }
    else if(PlayerInfo[targetid][pMember] == 4 || PlayerInfo[targetid][pLeader] == 4)
		{ ftext = "Firemen/Paramedics"; }
 		else if(PlayerInfo[targetid][pMember] == 5 || PlayerInfo[targetid][pLeader] == 5)
		{ ftext = "Sureсos"; }
		else if(PlayerInfo[targetid][pMember] == 6 || PlayerInfo[targetid][pLeader] == 6)
		{ ftext = "Norteсos"; }
		else if(PlayerInfo[targetid][pMember] == 11 || PlayerInfo[targetid][pLeader] == 11)
		{ ftext = "License Faction"; }
		else if(PlayerInfo[targetid][pMember] == 12 || PlayerInfo[targetid][pLeader] == 12)
		{ ftext = "Crips"; }
		else if(PlayerInfo[targetid][pMember] == 13 || PlayerInfo[targetid][pLeader] == 13)
		{ ftext = "Bloods"; }
		else if(PlayerInfo[targetid][pMember] == 14 || PlayerInfo[targetid][pLeader] == 14)
		{ ftext = "Latin Kings"; }
		else
		{ ftext = "None"; }
		new f2text[20];
	  if(PlayerInfo[targetid][pFMember] < 255) { f2text = FamilyInfo[PlayerInfo[targetid][pFMember]][FamilyName]; }
		else { f2text = "None"; }
	  new rtext[64];
I searched careful, but still can't find the bug. Could you help me?
Reply


Forum Jump:


Users browsing this thread: