Jump to content
  • 0

Problema /cuff 0.3e


diablo16

Question

Salut , as avea nevoie de putin ajutor cu /cuff , cand dau cuff unui player ii apar catusele doar pe mana dreapta.

Am facut update la include dar acelasi lucru.....

SS:

samp037si.png

[img width=500 height=375] samp038jt.png

Aici este codul:

new SPECIAL_ACTION_CUFFED;

if(strcmp(cmd, "/cuff", true) == 0)
       {
           if(IsPlayerConnected(playerid))
           {
                       if(IsACop(playerid))
                       {
                           tmp = strtok(cmdtext, idx);
                               if(!strlen(tmp)) {
                                       SendClientMessage(playerid, COLOR_WHITE, "USAGE: /cuff [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, "   You can't Cuff Cops !");
                                               return 1;
                                       }
                                           if(PlayerCuffed[giveplayerid] > 0)
                                           {
                                               SendClientMessage(playerid, COLOR_GREY, "   Player already Cuffed !");
                                               return 1;
                                           }
                                               if (ProxDetectorS(3.0, playerid, giveplayerid))
                                               {
                                                   if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You cannot Cuff yourself!"); return 1; }
                                                       GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                                                               GetPlayerName(playerid, sendername, sizeof(sendername));
                                                       format(string, sizeof(string), "* %s ti-a pus catusele pe maini, nu mai poti pelca nicaieri.", sendername);
                                                               SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
                                                               format(string, sizeof(string), "* I-ai pus catusile lui %s, sa nu mai poata pleca nicaieri.", giveplayer);
                                                               SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                                                               format(string, sizeof(string), "* %s i-a pus catusile lui %s.", sendername ,giveplayer);
                                                               ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                                                               GameTextForPlayer(giveplayerid, "~r~Cuffed", 2500, 3);
                                                               SetPlayerAttachedObject(giveplayerid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000);
                                                               SetPlayerSpecialAction(giveplayerid,SPECIAL_ACTION_CUFFED);
                                                               PlayerCuffed[giveplayerid] = 2;
                                                               PlayerCuffedTime[giveplayerid] = 180;
                                               }
                                               else
                                               {
                                                   SendClientMessage(playerid, COLOR_GREY, "   Acest player nu este langa tine !");
                                                   return 1;
                                               }
                                       }
                               }
                               else
                               {
                                   SendClientMessage(playerid, COLOR_GREY, "   Acest player este Offline !");
                                   return 1;
                               }
                       }
                       else
                       {
                               SendClientMessage(playerid, COLOR_GREY, "   Nu esti Cop / S.W.A.T / National Guard !");
                       }
               }
               return 1;
       }
    if(strcmp(cmd, "/uncuff", true) == 0)
       {
           if(IsPlayerConnected(playerid))
           {
                       if(IsACop(playerid))
                       {
                           tmp = strtok(cmdtext, idx);
                               if(!strlen(tmp)) {
                                       SendClientMessage(playerid, COLOR_WHITE, "USAGE: /uncuff [Playerid/PartOfName]");
                                       return 1;
                               }
                               giveplayerid = ReturnUser(tmp);
                               if(IsPlayerConnected(giveplayerid))
                               {
                                       if(giveplayerid != INVALID_PLAYER_ID)
                                       {
                                           if (ProxDetectorS(3.0, playerid, giveplayerid))
                                               {
                                                   if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You cannot Uncuff yourself!"); return 1; }
                                                       if(PlayerCuffed[giveplayerid])
                                                       {
                                                           GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                                                               GetPlayerName(playerid, sendername, sizeof(sendername));
                                                           format(string, sizeof(string), "* %s ti-a dat catusile jos.", sendername);
                                                               SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
                                                               format(string, sizeof(string), "* I-ai dat catusile jos lui %s.", giveplayer);
                                                               SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                                                               GameTextForPlayer(giveplayerid, "~g~Uncuffed", 2500, 3);
                                                               for(new i;i<10;i++) RemovePlayerAttachedObject(giveplayerid,i);
                                                               SetPlayerSpecialAction(giveplayerid,SPECIAL_ACTION_NONE);
                                                               TogglePlayerControllable(giveplayerid, 1);
                                                               PlayerCuffed[giveplayerid] = 0;
                                                       }
                                                       else
                                                       {
                                                           SendClientMessage(playerid, COLOR_GREY, "   That player isn't Tied up !");
                                                           return 1;
                                                       }
                                               }
                                               else
                                               {
                                                   SendClientMessage(playerid, COLOR_GREY, "   Acest player nu este langa tine !");
                                                   return 1;
                                               }
                                       }
                               }
                               else
                               {
                                   SendClientMessage(playerid, COLOR_GREY, "   Acest player este Offline !");
                                   return 1;
                               }
                       }
                       else
                       {
                               SendClientMessage(playerid, COLOR_GREY, "   Nu esti Cop / S.W.A.T / National Guard !");
                       }
               }//not connected
               return 1;
       }

Va rog ajutati-ma !

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

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.