[PROBLEME] Commande /mvp
#1

Bonjour,
J'ai un soucis avec ma commande /mvp, je m'explique, quand je /cuff un joueur il ne peut plus bouger ok. Mais quand j'utilise la commande /mvp la personne monte dans le vйhicule et la il peut sortir lui mкme et quand il sort bin sa le /uncuff tous seul, et quand je veut le /cuff une fois sortie sa me dit que le joueur est dйjа menotter.

Code:
	if(strcmp(cmd, "/forcer", true) == 0 || strcmp(cmd, "/mvp", true) == 0 || strcmp(cmd, "/tirer", true) == 0)
	//if(strcmp(cmd, "/tirer", true) == 0) // by LordMan
	{
	    new suspect = GetClosestPlayer(playerid);
	    if(gTeam[playerid] == 2 || IsACop(playerid))
      {
				    if(GetDistanceBetweenPlayers(playerid,suspect) < 5)
					{
            tmp = strtok(cmdtext, idx);
             if (!strlen(tmp))
                 return SendClientMessage(playerid, COLOR_YELLOW, "UTILISATION: /forcer [ID] [Place : 1,2,3]");
             new person = strval(tmp);
             tmp = strtok(cmdtext, idx);
             if (!strlen(tmp))
                 return SendClientMessage(playerid, COLOR_YELLOW, "UTILISATION: /mvp [ID] [1,2,3]");
             new seat = strval(tmp);
             new Float:pos[6];
             GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
             GetPlayerPos(person, pos[3], pos[4], pos[5]);
             format(string, sizeof(string), "* L'Officier embarque le suspect dans le vйhicule.");
             ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			 if (floatcmp(floatabs(floatsub(pos[0], pos[3])), 10.0) != -1 &&
             floatcmp(floatabs(floatsub(pos[1], pos[4])), 10.0) != -1 &&
             floatcmp(floatabs(floatsub(pos[2], pos[5])), 10.0) != -1) return false;

             PutPlayerInVehicle(person, GetPlayerVehicleID(playerid), seat);
          }
          else
          {
              SendClientMessage(playerid, COLOR_GREY, "Vous кtes trop loin du joueur pour pouvoir l'embarquer !");
           }
      }
      else
      {
           SendClientMessage(playerid, COLOR_GREY, "Vous n'кtes pas un policier !");
        }

   return 1;
	}
Code:
    if(strcmp(cmd, "/menotter", true)==0||strcmp(cmd, "/cu", true) ==0 || strcmp(cmd, "/cuff", true) == 0)
	//if(strcmp(cmd, "/menotter", true) == 0 || strcmp(cmd, "/men", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			if(gTeam[playerid] == 2 || IsACop(playerid))
			{
			    tmp = strtok(cmdtext, idx);
				if(!strlen(tmp)) {
					SendClientMessage(playerid, COLOR_WHITE, "USAGE: /menotter [Playerid/PartOfName]");
					return 1;
				}
				giveplayerid = ReturnUser(tmp);
			    if(IsPlayerConnected(giveplayerid))
				{
				    if(giveplayerid != INVALID_PLAYER_ID)
				    {
				        if(gTeam[giveplayerid] == 2 || IsACop(giveplayerid))
				        {
				            SendClientMessage(playerid, COLOR_GREY, "Vous ne pouvez pas menotter un policier!");
					        return 1;
				        }
					    if(PlayerCuffed[giveplayerid] == 2)
					    {
					        SendClientMessage(playerid, COLOR_GREY, "Joueur dйjа menottй!");
					        return 1;
					    }
						if (ProxDetectorS(8.0, playerid, giveplayerid))
						{
						    if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "Vous ne pouvez pas vous menotte vous mкme!"); return 1; }
						    if(GetPlayerState(giveplayerid) != GetPlayerState(playerid)) { SendClientMessage(playerid, COLOR_GREY, "Ce joueur doit etre en dehors du vйhicule (ou vous devez etre en dehors)"); return 1; }
						    if(GetPlayerState(playerid) == 1)
						    {
						        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
								GetPlayerName(playerid, sendername, sizeof(sendername));
						        format(string, sizeof(string), "Vous avez йtй menottй par %s, jusqu'а ce qu'un policier vous dйmenotte.", sendername);
								SendClientMessage(giveplayerid, COLOR_WHITE, string);
								format(string, sizeof(string), "Vous avez menottй %s, jusqu'a ce qu'un policier vous dйmenotte.", giveplayer);
								SendClientMessage(playerid, COLOR_WHITE, string);
								format(string, sizeof(string), "* %s а menottй %s, il ne poura allez nul part.", sendername ,giveplayer);
								ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
								GameTextForPlayer(giveplayerid, "~r~Menotter", 2500, 3);
								TogglePlayerControllable(giveplayerid, 0);
								PlayerCuffed[giveplayerid] = 2;
								PlayerCuffedTime[giveplayerid] = 99999999999999;
						    }
						    else
						    {
						        SendClientMessage(playerid, COLOR_GREY, "Ce joueur n'est pas dans votre voiture, ou vous n'кtes pas le conducteur!");
						        return 1;
						    }
						}
						else
						{
						    SendClientMessage(playerid, COLOR_GREY, "Ce joueur n'est pas prиs de vous!");
						    return 1;
						}
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_GREY, "Ce joueur n'est pas connectй!");
				    return 1;
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GREY, "Vous n'кtes pas policier!");
			}
		}
		return 1;
	}
	if(strcmp(cmd, "/recuff", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			if(PlayerInfo[playerid][pMember]==1||PlayerInfo[playerid][pLeader]==1||PlayerInfo[playerid][pMember]==3||PlayerInfo[playerid][pLeader]==3||PlayerInfo[playerid][pMember]==8||PlayerInfo[playerid][pLeader]==8)
			{
			    tmp = strtok(cmdtext, idx);
				if(!strlen(tmp)) {
					SendClientMessage(playerid, COLOR_WHITE, "USAGE: /remenotter [Playerid/PartOfName]");
					return 1;
				}
				giveplayerid = ReturnUser(tmp);
			    if(IsPlayerConnected(giveplayerid))
				{
				    if(giveplayerid != INVALID_PLAYER_ID)
				    {
						if (ProxDetectorS(8.0, playerid, giveplayerid))
						{

						    if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "Vous ne pouvez pas vous remenottez vous-mкme!"); return 1; }
						    {
						        new playa;
						        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
								GetPlayerName(playerid, sendername, sizeof(sendername));
								TogglePlayerControllable(playa, 1);
							    format(string, sizeof(string), "* Vous avez йtй remenottй par %s, jusqu'a ce que vous vous libйrй.", sendername);
								SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
								format(string, sizeof(string), "* Vous avez vйrifier les menotte de %s, ils sont bien sйrй.", giveplayer);
								SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
								format(string, sizeof(string), "* %s Vйrifie les menote а %s .", sendername ,giveplayer);
								ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
								GameTextForPlayer(giveplayerid, "~r~Vous avez vйrifier les menotte!", 2500, 3);
								TogglePlayerControllable(giveplayerid, 0);
								PlayerCuffed[giveplayerid] = 5;
								PlayerCuffedTime[giveplayerid] = 9999;
						    }

						}
						else
						{
						    SendClientMessage(playerid, COLOR_GREY, "   Ce joueur n'est pas prиs de vous!");
						    return 1;
						}
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_GREY, "   Ce joueur est hors ligne!");
				    return 1;
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GREY, "  Vous n'кtes pas Policier!");
			}
		}
		return 1;
	}
	if(strcmp(cmd, "/uncuff", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			if(IsALawEnforcer(playerid))
			{
			    tmp = strtok(cmdtext, idx);
				if(!strlen(tmp)) {
					SendClientMessage(playerid, COLOR_WHITE, "SERVEUR: /uncuff [Joueurid/Nom ou Prйnom]");
					return 1;
				}
				giveplayerid = ReturnUser(tmp);
				if(IsPlayerConnected(giveplayerid))
				{
					if(giveplayerid != INVALID_PLAYER_ID)
					{
					    if (ProxDetectorS(8.0, playerid, giveplayerid))
						{
						    if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "Vous ne pouvez pas vous dйmenotter!"); return 1; }
						    if(OnDuty[playerid] != 1)
							{
			    				SendClientMessage(playerid, COLOR_GREY, "   Vous n'кtes pas en service!");
			    				return 1;
							}
							if(PlayerCuffed[giveplayerid])
							{
							    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
								GetPlayerName(playerid, sendername, sizeof(sendername));
							    format(string, sizeof(string), "* Vous avez йtй demenotter par %s.", sendername);
								SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
								format(string, sizeof(string), "* Vous avez demenottй %s.", giveplayer);
								SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
								GameTextForPlayer(giveplayerid, "~g~DEMENOTTER", 2500, 3);
								TogglePlayerControllable(giveplayerid, 1);
								PlayerCuffed[giveplayerid] = 0;
							}
							else
							{
							    SendClientMessage(playerid, COLOR_GREY, "   Ce joueur n'est pas menotter !");
							    return 1;
							}
						}
						else
						{
						    SendClientMessage(playerid, COLOR_GREY, "   Ce joueur n'est pas accotй de vous !");
						    return 1;
						}
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_GREY, "   Ce joueur n'est pas connectй !");
				    return 1;
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GREY, "   Vous n'кtes pas Policier / FBI / Militaire !");
			}
		}
		return 1;
	}
Reply


Messages In This Thread
[PROBLEME] Commande /mvp - by Rayane68 - 28.02.2011, 02:49
Re : [PROBLEME] Commande /mvp - by Cassandra_Ciesca - 28.02.2011, 03:34
Re: [PROBLEME] Commande /mvp - by Rayane68 - 28.02.2011, 11:50
Re: [PROBLEME] Commande /mvp - by Rayane68 - 28.02.2011, 17:18
Re : [PROBLEME] Commande /mvp - by cristab - 28.02.2011, 18:41

Forum Jump:


Users browsing this thread: 1 Guest(s)