SA-MP Forums Archive
My cuff system - 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: My cuff system (/showthread.php?tid=343195)



My cuff system - miley1 - 16.05.2012

Where do i add those lines

PHP код:
SetPlayerSpecialAction(giveplayeridSPECIAL_ACTION_CUFFED);                                
SetPlayerAttachedObject(giveplayerid0194186, -0.0110000.028000, -0.022000, -15.600012, -33.699977, -81.7000350.8919991.0000001.168000); 
Into my cuff system


PHP код:
    if(strcmp(cmd"/cuff"true) == || strcmp(cmd"/cu"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if(
IsACop(playerid) || IsAFreecop(playerid))
            {
                
tmp strtok(cmdtextidx);
                if(!
strlen(tmp)) {
                    
SendClientMessage(playeridCOLOR_WHITE"USAGE: /cuff [Playerid/PartOfName]");
                    return 
1;
                }
                if(
PlayerInfo[playerid][pDBanned] == 1)
                {
                    
SendClientMessage(playeridCOLOR_GREY"* You are Banned From Cop Duty!");
                    return 
1;
                }
                if(
PlayerInfo[playerid][pDuty] == 0)
                {
                    
SendClientMessage(playeridCOLOR_GREY"* You aren't on Duty!");
                    return 
1;
                }
                
giveplayerid ReturnUser(tmp);
                if(
IsPlayerConnected(giveplayerid))
                {
                    if(
giveplayerid != INVALID_PLAYER_ID)
                    {
                        if(
IsACop(giveplayerid) || IsAFreecop(giveplayerid))
                        {
                            
SendClientMessage(playeridCOLOR_GREY"* You can't Cuff Cops !");
                            return 
1;
                        }
                        if(
PlayerCuffed[giveplayerid] > 0)
                        {
                            
SendClientMessage(playeridCOLOR_GREY"* Player already Cuffed !");
                            return 
1;
                        }
                        if (
ProxDetectorS(8.0playeridgiveplayerid))
                        {
                            if(
giveplayerid == playerid) return SendClientMessage(playeridCOLOR_GREY"You cannot cuff yourself!");
                            
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
                              
format(stringsizeof(string), "* You were Cuffed by %s, till uncuff."sendername);
                            
SendClientMessage(giveplayeridCOLOR_WHITEstring);
                            
format(stringsizeof(string), "* You Cuffed %s, till uncuff."giveplayer);
                            
SendClientMessage(playeridCOLOR_WHITEstring);
                            
format(stringsizeof(string), "* %s Hand Cuffs %s, so he wont go anywhere."sendername ,giveplayer);
                            
ProxDetector(30.0playeridstringCOLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
                            
GameTextForPlayer(giveplayerid"~r~Cuffed"25003);
                            
TogglePlayerControllable(giveplayerid0);
                            
PlayerCuffed[giveplayerid] = 1;
                            
cufftimer[giveplayerid] = SetTimerEx("CheckDist",10000,true,"ii",giveplayerid,playerid);
                        }
                        else
                        {
                            
SendClientMessage(playeridCOLOR_GREY"* That player is not near you !");
                            return 
1;
                        }
                    }
                }
                else
                {
                    
SendClientMessage(playeridCOLOR_GREY"* That player is Offline !");
                    return 
1;
                }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GREY"* You are not a Cop / FBI / National Guard !");
            }
        }
        return 
1;
    } 

Anyone know where ill add those lines/.? +1 rep if u answer me i dont want errors thats why i post


Re: My cuff system - mincer1667 - 16.05.2012

after PlayerCuffed[giveplayerid] = 1; should be fine


Re: My cuff system - miley1 - 16.05.2012

ok ima try it bro


Re: My cuff system - Ballu Miaa - 16.05.2012

Over Here.

pawn Код:
if (ProxDetectorS(8.0, playerid, giveplayerid))
                        {
                            if(giveplayerid == playerid) return SendClientMessage(playerid, COLOR_GREY, "You cannot cuff yourself!");
                            GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                              format(string, sizeof(string), "* You were Cuffed by %s, till uncuff.", sendername);
                            SendClientMessage(giveplayerid, COLOR_WHITE, string);
                            format(string, sizeof(string), "* You Cuffed %s, till uncuff.", giveplayer);
                            SendClientMessage(playerid, COLOR_WHITE, string);
                            format(string, sizeof(string), "* %s Hand Cuffs %s, so he wont go anywhere.", sendername ,giveplayer);
                            ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
                            GameTextForPlayer(giveplayerid, "~r~Cuffed", 2500, 3);
                            TogglePlayerControllable(giveplayerid, 0);
                            PlayerCuffed[giveplayerid] = 1;
                            cufftimer[giveplayerid] = SetTimerEx("CheckDist",10000,true,"ii",giveplayerid,playerid);
                           SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_CUFFED);                                
                           SetPlayerAttachedObject(giveplayerid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000);

                        }