SA-MP Forums Archive
/acceptinvite - 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: /acceptinvite (/showthread.php?tid=340999)



/acceptinvite - prokiller2 - 09.05.2012

I need to change my command with /acceptinvite

Код:
if(strcmp(cmd, "/invite", true) == 0)
 	{
     	if(IsPlayerConnected(playerid))
     	{
   			tmp = strtok(cmdtext, idx);
   			if(!strlen(tmp))
   			{
    			SendClientMessage(playerid, COLOR_WHITE, "{37F906}INFO:{FFFFFF} /invite [ID/Ime na Igracot].");
    			return 1;
			}
   			new para1;
   			new ftext[20];
   			para1 = ReturnUser(tmp);
   			if (PlayerInfo[playerid][pLeader] >= 1)
   			{
       			if(IsPlayerConnected(para1))
       			{
           			if(para1 != INVALID_PLAYER_ID)
           			{
     					if (gTeam[para1] == TEAM_GREEN && PlayerInfo[para1][pMember] == 0 && PlayerInfo[para1][pFMember] == 255)
     					{
			              	if(PlayerInfo[playerid][pLeader] == 1) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "PD"; ChosenSkin[para1] = 282; SetPlayerSkin(para1, 282); }
			              	else if(PlayerInfo[playerid][pLeader] == 2) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "FBI"; ChosenSkin[para1] = 24; SetPlayerSkin(para1, 24); }
			              	else if(PlayerInfo[playerid][pLeader] == 3) { PlayerInfo[para1][pTeam] = 2; gTeam[para1] = 2; ftext = "SWAT"; ChosenSkin[para1] = 285; SetPlayerSkin(para1, 285); }
			              	else if(PlayerInfo[playerid][pLeader] == 4) { PlayerInfo[para1][pTeam] = 1; gTeam[para1] = 1; ftext = "MD"; ChosenSkin[para1] = 276; SetPlayerSkin(para1, 276); }
			              	//else if(PlayerInfo[playerid][pLeader] == 5) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ftext = "Yakuza"; ChosenSkin[para1] = 121; SetPlayerSkin(para1, 121); }
			              	//else if(PlayerInfo[playerid][pLeader] == 6) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ftext = "LCN"; ChosenSkin[para1] = 112; SetPlayerSkin(para1, 112); }
			              	else if(PlayerInfo[playerid][pLeader] == 7) { PlayerInfo[para1][pTeam] = 7; gTeam[para1] = 7; ftext = "VLADA"; ChosenSkin[para1] = 164; SetPlayerSkin(para1, 164); }
			              	//else if(PlayerInfo[playerid][pLeader] == 8) { PlayerInfo[para1][pTeam] = 10; gTeam[para1] = 12; ftext = "Hitman"; ChosenSkin[para1] = 20; SetPlayerSkin(para1, 20); }
			              	else if(PlayerInfo[playerid][pLeader] == 9) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "LSN"; ChosenSkin[para1] = 1; SetPlayerSkin(para1, 1); }
			              	//else if(PlayerInfo[playerid][pLeader] == 10) { PlayerInfo[para1][pTeam] = 12; gTeam[para1] = 12; ftext = "Taxi"; ChosenSkin[para1] = 210; SetPlayerSkin(para1, 210); }
			              	//else if(PlayerInfo[playerid][pLeader] == 12) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ftext = "LSG"; ChosenSkin[para1] = 175; SetPlayerSkin(para1, 175); }
			              	//else if(PlayerInfo[playerid][pLeader] == 13) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ftext = "Los Surenos"; ChosenSkin[para1] = 175; SetPlayerSkin(para1, 175); }
			              	//else if(PlayerInfo[playerid][pLeader] == 14) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ftext = "Carbon Racer's"; ChosenSkin[para1] = 23; SetPlayerSkin(para1, 23); }
			              	//else if(PlayerInfo[playerid][pLeader] == 15) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ftext = "GSF"; ChosenSkin[para1] = 105; SetPlayerSkin(para1, 105); }
			              	//else if(PlayerInfo[playerid][pLeader] == 16) { PlayerInfo[para1][pTeam] = 5; gTeam[para1] = 5; ftext = "LSV"; ChosenSkin[para1] = 108; SetPlayerSkin(para1, 108); }
			              	else { return 1; }
			        		GetPlayerName(para1, giveplayer, sizeof(giveplayer));
			        		GetPlayerName(playerid, sendername, sizeof(sendername));
			       	 		PlayerInfo[para1][pMember] = PlayerInfo[playerid][pLeader];
			        		PlayerInfo[para1][pRank] = 1;
			       	 		printf("AdmCmd: %s go povika %s da se prikluci vo %s.", sendername, giveplayer, ftext);
			        		format(string, sizeof(string), "{37F906}INFO:{FFFFFF}Pokaneti ste vo %s, od %s", ftext, sendername);
			        		SendClientMessage(para1, COLOR_WHITE, string);
			        		format(string, sizeof(string), "{37F906}INFO:{FFFFFF}Go pokanivte %s da vleze vo %s.", giveplayer,ftext);
			        		SendClientMessage(playerid, COLOR_WHITE, string);
				        	/*new rand = random(sizeof(gInviteSpawns));
				        	SetPlayerPos(para1, gInviteSpawns[rand][0], gInviteSpawns[rand][1], gInviteSpawns[rand][2]); // Warp the player
				        	SetPlayerFacingAngle(para1, gInviteSpawns[rand][3]);
				        	SetPlayerCameraPos(para1,gInviteSpawns[rand][0] + 3, gInviteSpawns[rand][1], gInviteSpawns[rand][2]);
				        	SetPlayerCameraLookAt(para1,gInviteSpawns[rand][0], gInviteSpawns[rand][1], gInviteSpawns[rand][2]);
				        	TogglePlayerControllable(para1, 0);
				           	SelectChar[para1] = 255;
				           	SelectCharID[para1] = PlayerInfo[para1][pMember];
				           	SelectCharPlace[para1] = 1;
				        	OdjecaID1[para1] = 1;
				           	PlayerInfo[para1][pModel] = ChosenSkin[para1];
				           	PlayerInfo[para1][pChar] = ChosenSkin[para1];
				           	SendClientMessage(para1, COLOR_WHITE, "* Koristi Lijevi klik misa da biras skin.");
				           	SendClientMessage(para1, COLOR_WHITE, "* Kada odaberes koristi C na tipkovnici.");*/
       					}
				       	else
			       		{
          					SendClientMessage(playerid, WHITE, "{FF0000}GRESKA:{FFFFFF}Igracot e vo nekoja organizacija.");
				           	return 1;
			       		}
  					}
   				}//not connected
   			}
	   		else
	   		{
    		SendClientMessage(playerid, WHITE, "{FF0000}GRESKA:{FFFFFF}Nemozete da ja koristite ovaa komanda.");
			}
		}
		return 1;
	}



Re: /acceptinvite - Tom1412 - 09.05.2012

what do you need doing to the command