Jump to content
  • 0

Problema /invite


MrAndrei

Question

Problema intalnita (descriere): Comanda /invite nu functioneaza cum trebuie.
Ero(area / rile) / warning-(ul / urile): Cand dau invite unui player, acesta intra in factiune, insa,dupa relog acesta ramane civil. Totodata, dupa comanda .invite acesta este spawnat sub pamanat nici de cum la hq.
Liniile de cod / sursa / script-ul(obligatoriu): 

if(strcmp(cmd, "/invite", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        new tmp[222];
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_SYN, "Syntax: /invite [ID/nume jucator]");
				return 1;
			}
			new para1;
			new ttext[220];
			para1 = ReturnUser(tmp);
			if(PlayerInfo[para1][pLeader] != 0)
			{
			    SendClientMessage(playerid, -1, "Acest jucator este liderul unei factiuni!");
			    return 1;
			}
			if(PlayerInfo[playerid][pLeader] >= 1)
			{
			    if(IsPlayerConnected(para1))
			    {
			        if(para1 != INVALID_PLAYER_ID)
			        {
					    if (PlayerInfo[para1][pMember] == 0 && WantedLevel[playerid] == 0)
					    {
					       /* if(PlayerInfo[para1][pFpunish] > 1)
					        {
					            SendClientMessage(playerid, COLOR_WHITE, "* Nu-l poti invita pe acest jucator, are FPunish!");
					            return 1;
					        }*/
					        if(PlayerInfo[playerid][pLeader] == 1) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ttext = "SA Police Departament"; ChosenSkin[para1] = 280; SetPlayerSkin(para1, 280); }
					        else if(PlayerInfo[playerid][pLeader] == 2) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ttext = "Federal Bureau Of Investigation"; ChosenSkin[para1] = 286; SetPlayerSkin(para1, 286); }
					        else if(PlayerInfo[playerid][pLeader] == 3) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ttext = "National Guard"; ChosenSkin[para1] = 287; SetPlayerSkin(para1, 287); }
					        else if(PlayerInfo[playerid][pLeader] == 4) { PlayerInfo[para1][pTeam] = 1; gTeam[para1] = 1; ttext = "Firemen/Ambulance"; ChosenSkin[para1] = 70; SetPlayerSkin(para1, 70); }
					        else if(PlayerInfo[playerid][pLeader] == 5) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ttext = "Clanton 14th Street"; ChosenSkin[para1] = 258; SetPlayerSkin(para1, 120); }
					        else if(PlayerInfo[playerid][pLeader] == 6) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ttext = "18th Street Gang"; ChosenSkin[para1] = 120; SetPlayerSkin(para1, 258); }
					        else if(PlayerInfo[playerid][pLeader] == 7) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ttext = "East Beach Bloods"; ChosenSkin[para1] = 4; SetPlayerSkin(para1, 4); }
					        else if(PlayerInfo[playerid][pLeader] == 8) { PlayerInfo[para1][pTeam] = 10; gTeam[para1] = 12; ttext = "Hitman Agency"; ChosenSkin[para1] = 127; SetPlayerSkin(para1, 127); }
					        else if(PlayerInfo[playerid][pLeader] == 9) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ttext = "News Reporter"; ChosenSkin[para1] = 148; SetPlayerSkin(para1, 148); }
					        else if(PlayerInfo[playerid][pLeader] == 10) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ttext = "Taxi Cab Company"; ChosenSkin[para1] = 255; SetPlayerSkin(para1, 255); }
					        else if(PlayerInfo[playerid][pLeader] == 11) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ttext = "School Instructors"; ChosenSkin[para1] = 59; SetPlayerSkin(para1, 59); }
                            else if(PlayerInfo[playerid][pLeader] == 12) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ttext = "Tow Car Company"; ChosenSkin[para1] = 34; SetPlayerSkin(para1, 34); }
                            else if(PlayerInfo[playerid][pLeader] == 13) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ttext = "Grove Street"; ChosenSkin[para1] = 34; SetPlayerSkin(para1, 34); }
							else { return 1; }
							new giveplayer[MAX_PLAYER_NAME];
							GetPlayerName(para1, giveplayer, sizeof(giveplayer));
							GetPlayerName(playerid, sendername, sizeof(sendername));
							//PlayerInfo[para1][pMember] = PlayerInfo[playerid][pLeader];
							new factionid;

							Update(targetid, pMemberu);
							PlayerInfo[targetid][pLeader] = factionid;
							PlayerInfo[targetid][pMember] = factionid;
							PlayerInfo[para1][pRank] = 1;
							printf("ADMIN INFO: %s l-a invitat pe %s in factiunea %s.", sendername, giveplayer, ttext);
							format(string, sizeof(string), "* Ai intrat in %s, deoarece ai fost invitat de catre liderul %s.", ttext, sendername);
							SendClientMessage(para1, COLOR_LIGHTBLUE, string);
							format(string, sizeof(string), "* L-ai invitat pe %s sa intre in factiunea ta (%s).", giveplayer,ttext);
							SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
							SetPlayerInterior(para1,0);
							SetPlayerHealth(para1, 0);
						    SelectCharID[para1] = PlayerInfo[para1][pMember];
						    PlayerInfo[para1][pModel] = ChosenSkin[para1];
						    
						    
					    	PlayerInfo[para1][pChar] = ChosenSkin[para1];
						}
						else
						{
						    SendClientMessage(playerid, COLOR_WHITE, "* Acest jucator are wanted/faction punish sau este deja intr-o familie!");
						    return 1;
						}
					}
				}//not connected
			}
			else
			{
				SendClientMessage(playerid, COLOR_ERROR, "Error: Your leader level is not high enough to use this command.");
			}
		}
		return 1;
	}


Imagini / Video (optional): -
Ati incercat sa rezolvati singur?:  Am incercat, dar fara succes. Va multumesc..

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0
  • 0
Update(targetid, pMemberu);

 

case pMemberu:
				{
					mysql_format(handle, string, sizeof(string), "UPDATE `players` SET `Member`='%d' WHERE `username`='%e'", PlayerInfo[playerid][pMember], playerName);
					mysql_query(handle, string);
				}

 

Link to comment
Share on other sites

  • 0
  • 0
  • 0
On 26.11.2015, 06:57:51, WiDuAlK.SaMp said:

cum ai pus la onplayerspawn?

 

if (PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4)// News Reporters
        {
            SetPlayerFactionColor(playerid);

            PlayerInfo[playerid][pInterior] = 3;
            SetPlayerInterior(playerid, 3);

            SetPlayerPos(playerid, -2029.798339,-106.675910,1035.171875);
            SetPlayerFacingAngle(playerid, 0);
            return 1;
        }

Link to comment
Share on other sites

  • 0
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.