[Ajuda] 2 Comandos '-'
#1

Pessoal queria que o comando /assaltar so funciona-se se a pessoa dar /handsup
Код:
    if(strcmp(cmd, "/assaltar", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD1, "USO: /assaltar [playerid/Parte-do-Nick] [quantia]");
				return 1;
			}
			//giveplayerid = strval(tmp);
	        giveplayerid = ReturnUser(tmp);
			if(RoubarPlayerTime[playerid] == 1)
	        {
                   SendClientMessage(playerid, COLOR_GREY, "  Vocк precisa esperar 5 minutos para usar esse comando denovo !");
                   return 1;
            }
            if(gTeam[playerid] == 2 || IsACop(playerid))
	        {
            SendClientMessage(playerid, COLOR_GREY, "Homens da lei nгo podem assaltar, isso й crime");
	        return 1;
            }
			if (IsPlayerConnected(giveplayerid))
			{
			    if(giveplayerid != INVALID_PLAYER_ID)
			    {
			        if(PlayerInfo[giveplayerid][pLocal] == 106)
					{
						SendClientMessage(playerid, COLOR_GRAD1, "Este comando nгo й habilitado para se usar nesse lugar.");
						return 1;
					}
					/*if(PlayerInfo[giveplayerid][pMember] > 0)
					{
						SendClientMessage(playerid, COLOR_GRAD1, "Vocк sу pode assaltar um civil.");
						return 1;
					}*/
					if (ProxDetectorS(5.0, playerid, giveplayerid))
					{
						GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						new pcash = robumonttt;
                        new robcash = random(pcash);
						playermoney = GetPlayerGP(giveplayerid);
						if(playermoney <= 999)
				    	{
					    	SendClientMessage(playerid, COLOR_GRAD1, "O jogador estб sem grana nгo adianta rouba-lo");
					    	return 1;
					    }
						if(PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5 || PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6 || PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12 || PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13
                    	|| PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14 || PlayerInfo[playerid][pMember] == 15 || PlayerInfo[playerid][pLeader] == 15 || PlayerInfo[playerid][pMember] == 19 || PlayerInfo[playerid][pLeader] == 19 || PlayerInfo[playerid][pMember] == 20 || PlayerInfo[playerid][pLeader] == 20 || PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 16
                    	|| PlayerInfo[playerid][pMember] == 17 || PlayerInfo[playerid][pLeader] == 17 || PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13 || PlayerInfo[playerid][pMember] == 18 || PlayerInfo[playerid][pLeader] == 18 || PlayerInfo[playerid][pMember] == 10 || PlayerInfo[playerid][pLeader] == 10 || PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11 )
                     	{
                            if(!IsPlayerInAnyVehicle(playerid))//animcon
		                	{
                                GivePlayerGP(giveplayerid, (0 - robcash));
	                            GivePlayerGP(playerid, robcash);
				     			LoopingAnim(playerid,"PED","gang_gunstand",4.0,1,1,1,1,1);
				    			SetPlayerSpecialAction(giveplayerid,SPECIAL_ACTION_HANDSUP);
					    		SetTimerEx("Roubarplayer", 10000, false, "i", playerid);
					    		SetTimerEx("Roubarplayer2", 10000, false, "i", giveplayerid);
					    		RoubarPlayerTime[playerid] = 1;
                                SetTimerEx("RoubarPlayerTimer", 300000, false, "i", playerid);
                                SetPlayerCriminal(playerid,255, "Assalto a mгo armada");
                                WantedPoints[playerid] += 1;
		            			SetPlayerWantedLevel(playerid, WantedPoints[playerid]);
				    			format(string, sizeof(string), "%s passou a mгo na carteira de %s.", sendername ,giveplayer);
				    			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
	                        }
					    	else
					    	{
					    		SendClientMessage(playerid, COLOR_GRAD1, " Use esse comando somente fora do carro");
					     	}
						}
						else
						{
							SendClientMessage(playerid, COLOR_GRAD1, " Vocк nao pode assaltar!");
						}
					}
					else
					{
						SendClientMessage(playerid, COLOR_GRAD1, "   Vocк estб longe do persongem");
					}
				}//invalid id
			}
			else
			{
				format(string, sizeof(string), "   %d nгo й um jogador Ativo.", giveplayerid);
				SendClientMessage(playerid, COLOR_GRAD1, string);
			}
		}
	}
Pessoal tipo eu dou /irin e vou certinho ai quando eu dou /irteste e algum player vai ele comeзa a cair no infinito '-'

Код:
 	if(strcmp(cmd, "/irin", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			if (PlayerInfo[playerid][pAdmin] >= 1)
			{
				if (GetPlayerState(playerid) == 4)
				{
					new tmpcar = GetPlayerVehicleID(playerid);
					SetVehiclePos(tmpcar, 1416.107000,0.268620,1000.926000);
				}
				else
				{
					SetPlayerPos(playerid, 1416.107000,0.268620,1000.926000);
				}
				SendClientMessage(playerid, COLOR_GRAD1, "   Vocк foi teleportado");
				SetPlayerInterior(playerid,1);
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo pode usar esse comando!");
			}
		}
		return 1;
	}
Alguem poderia me ajudar??

Obrigado
Reply
#2

sou novato nгo sei meche muito mas por enquanto estou modificando um as vezes tento scripta, mas quando eu aprender direitinho eu irei fazer meu proprio game mode
Reply
#3

Aeew manow... no segundo caixinha de pawn vc tem ke por a coordenada certa.. pra ele sair encima da pessoa... nгo enbaixo!! Procure arrumar a coordenada...

SetVehiclePos(tmpcar, 1416.107000,0.268620,1000.926000);
}
else
{
SetPlayerPos(playerid, 1416.107000,0.268620,1000.926000);
}




Daii vc muda isso!! no setvehiclepos e o setplayerpos! (coordenadas!)
Reply
#4

https://sampwiki.blast.hk/wiki/GetPlayerAnimationIndex
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)