Need Help, CUFF
#1

Hello all, so I searched on some older topics when the "BETA" of 0.3e was released. I found this code, and translated it to english, and corrected to if(IsPlayerAdmin(playerid)) instead of gTeam and Cop etc.

ServerFFS is CRAP and haven't released the 0.3e yet, so I was just wondering if this code will work? If not, please correct :

pawn Код:
if(strcmp(cmd, "/cuff", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(IsPlayerAdmin(playerid))
            {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_RED, ".:: Correction: /cuff [id/name] ::.");
                    return 1;
                }
                giveplayerid = ReturnUser(tmp);
                if(IsPlayerConnected(giveplayerid))
                {
                    if(giveplayerid != INVALID_PLAYER_ID)
                    {
                        if(IsPlayerAdmin(playerid))
                        {
                            SendClientMessage(playerid, COLOR_CRVENA, ".:: You cant cuff an Officer! ::.");
                            return 1;
                        }
                        if (ProxDetectorS(8.0, playerid, giveplayerid))
                        {
                                if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_CRVENA, ".:: You cant Cuff youself! ::."); return 1; }
                                GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                                GetPlayerName(playerid, sendername, sizeof(sendername));
                                format(string, sizeof(string), ".:: ( %s ) has Cuffed ( %s ) and he cant move! ::.", sendername ,giveplayer);
                                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                                GameTextForPlayer(giveplayerid, "~r~Cuffed!", 2500, 3);
                                SendClientMessage(giveplayerid, COLOR_PLAVA, ".:: Lawyer: Anything you say can and will be used against you ::.");
                                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);
                                TogglePlayerControllable(giveplayerid, 0);
                                PlayerCuffed[giveplayerid] = 2;
                                PlayerCuffedTime[giveplayerid] = 9999;
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_CRVENA, ".:: This player is too far away from your Area ::.");
                            return 1;
                        }
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_CRVENA, ".:: Unavailable ID! No one has that ID ::.");
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_WHITE, ".:: You're Not a Cop, and therefor cant Cuff ::.");
            }
        }
        return 1;
    }
Reply
#2

Quote:
Originally Posted by Kudoz
Посмотреть сообщение
Hello all, so I searched on some older topics when the "BETA" of 0.3e was released. I found this code, and translated it to english, and corrected to if(IsPlayerAdmin(playerid)) instead of gTeam and Cop etc.

ServerFFS is CRAP and haven't released the 0.3e yet, so I was just wondering if this code will work? If not, please correct :

pawn Код:
if(strcmp(cmd, "/cuff", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(IsPlayerAdmin(playerid))
            {
                tmp = strtok(cmdtext, idx);
                if(!strlen(tmp))
                {
                    SendClientMessage(playerid, COLOR_RED, ".:: Correction: /cuff [id/name] ::.");
                    return 1;
                }
                giveplayerid = ReturnUser(tmp);
                if(IsPlayerConnected(giveplayerid))
                {
                    if(giveplayerid != INVALID_PLAYER_ID)
                    {
                        if(IsPlayerAdmin(playerid))
                        {
                            SendClientMessage(playerid, COLOR_CRVENA, ".:: You cant cuff an Officer! ::.");
                            return 1;
                        }
                        if (ProxDetectorS(8.0, playerid, giveplayerid))
                        {
                                if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_CRVENA, ".:: You cant Cuff youself! ::."); return 1; }
                                GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                                GetPlayerName(playerid, sendername, sizeof(sendername));
                                format(string, sizeof(string), ".:: ( %s ) has Cuffed ( %s ) and he cant move! ::.", sendername ,giveplayer);
                                ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                                GameTextForPlayer(giveplayerid, "~r~Cuffed!", 2500, 3);
                                SendClientMessage(giveplayerid, COLOR_PLAVA, ".:: Lawyer: Anything you say can and will be used against you ::.");
                                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);
                                TogglePlayerControllable(giveplayerid, 0);
                                PlayerCuffed[giveplayerid] = 2;
                                PlayerCuffedTime[giveplayerid] = 9999;
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_CRVENA, ".:: This player is too far away from your Area ::.");
                            return 1;
                        }
                    }
                }
                else
                {
                    SendClientMessage(playerid, COLOR_CRVENA, ".:: Unavailable ID! No one has that ID ::.");
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_WHITE, ".:: You're Not a Cop, and therefor cant Cuff ::.");
            }
        }
        return 1;
    }
PHP код:
if(strcmp(cmd"/cuff"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if(!
IsPlayerAdmin(playerid))
            {
                
tmp strtok(cmdtextidx);
                if(!
strlen(tmp))
                {
                    
SendClientMessage(playeridCOLOR_RED".:: Correction: /cuff [id/name] ::.");
                    return 
1;
                }
                
giveplayerid ReturnUser(tmp);
                if(
IsPlayerConnected(giveplayerid))
                {
                    if(
giveplayerid != INVALID_PLAYER_ID)
                    {
                        if(
IsPlayerAdmin(playerid))
                        {
                            
SendClientMessage(playeridCOLOR_CRVENA".:: You cant cuff an Officer! ::.");
                            return 
1;
                        }
                        if (
ProxDetectorS(8.0playeridgiveplayerid))
                        {
                                if(
giveplayerid == playerid) { SendClientMessage(playeridCOLOR_CRVENA".:: You cant Cuff youself! ::."); return 1; }
                                
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
                                
GetPlayerName(playeridsendernamesizeof(sendername));
                                
format(stringsizeof(string), ".:: ( %s ) has Cuffed ( %s ) and he cant move! ::."sendername ,giveplayer);
                                
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                                
GameTextForPlayer(giveplayerid"~r~Cuffed!"25003);
                                
SendClientMessage(giveplayeridCOLOR_PLAVA".:: Lawyer: Anything you say can and will be used against you ::.");
                                
SetPlayerSpecialAction(giveplayeridSPECIAL_ACTION_CUFFED);
                                
SetPlayerAttachedObject(giveplayerid0194186, -0.0110000.028000, -0.022000, -15.600012, -33.699977, -81.7000350.8919991.0000001.168000);
                                
TogglePlayerControllable(giveplayerid0);
                                
PlayerCuffed[giveplayerid] = 2;
                                
PlayerCuffedTime[giveplayerid] = 9999;
                        }
                        else
                        {
                            
SendClientMessage(playeridCOLOR_CRVENA".:: This player is too far away from your Area ::.");
                            return 
1;
                        }
                    }
                }
                else
                {
                    
SendClientMessage(playeridCOLOR_CRVENA".:: Unavailable ID! No one has that ID ::.");
                    return 
1;
                }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_WHITE".:: You're Not a Cop, and therefor cant Cuff ::.");
            }
        }
        return 
1;
    } 
Reply
#3

You should switch over to Volt-Host. Much better.
Reply
#4

Aw thanks people! Really appriciate it!
Reply
#5

Код:
 C:\Users\Kudoz\Desktop\Cyber DrifterZ V2\gamemodes\Cyberdrifterz0.3e.pwn(1638) : error 017: undefined symbol "tmp"
C:\Users\Kudoz\Desktop\Cyber DrifterZ V2\gamemodes\Cyberdrifterz0.3e.pwn(1639) : error 017: undefined symbol "tmp"
C:\Users\Kudoz\Desktop\Cyber DrifterZ V2\gamemodes\Cyberdrifterz0.3e.pwn(1644) : error 017: undefined symbol "giveplayerid"
C:\Users\Kudoz\Desktop\Cyber DrifterZ V2\gamemodes\Cyberdrifterz0.3e.pwn(1644) : error 017: undefined symbol "ReturnUser"
C:\Users\Kudoz\Desktop\Cyber DrifterZ V2\gamemodes\Cyberdrifterz0.3e.pwn(1645) : error 017: undefined symbol "giveplayerid"
C:\Users\Kudoz\Desktop\Cyber DrifterZ V2\gamemodes\Cyberdrifterz0.3e.pwn(1647) : error 017: undefined symbol "giveplayerid"
C:\Users\Kudoz\Desktop\Cyber DrifterZ V2\gamemodes\Cyberdrifterz0.3e.pwn(1654) : error 017: undefined symbol "ProxDetectorS"
C:\Users\Kudoz\Desktop\Cyber DrifterZ V2\gamemodes\Cyberdrifterz0.3e.pwn(1656) : error 017: undefined symbol "giveplayerid"
C:\Users\Kudoz\Desktop\Cyber DrifterZ V2\gamemodes\Cyberdrifterz0.3e.pwn(1657) : error 017: undefined symbol "giveplayerid"
C:\Users\Kudoz\Desktop\Cyber DrifterZ V2\gamemodes\Cyberdrifterz0.3e.pwn(1657) : error 017: undefined symbol "giveplayer"
C:\Users\Kudoz\Desktop\Cyber DrifterZ V2\gamemodes\Cyberdrifterz0.3e.pwn(1657) : error 029: invalid expression, assumed zero
C:\Users\Kudoz\Desktop\Cyber DrifterZ V2\gamemodes\Cyberdrifterz0.3e.pwn(1657) : fatal error 107: too many error messages on one line
these errors did i get after i downloaded the 0.3e pawno and copyed the whole GM + that script u game me
Need help asap!
Reply
#6

the script that you gave us works perfectly for me check your 0.3e files!
Reply
#7

Read what he said:

"Hello all, so I searched on some older topics when the "BETA" of 0.3e was released. I found this code, and translated it to english, and corrected to if(IsPlayerAdmin(playerid)) instead of gTeam and Cop etc.

ServerFFS is CRAP and haven't released the 0.3e yet, so I was just wondering if this code will work? If not, please correct :"

He is on 0.3d since ServerFFS hasn't released the 0.3e client on their servers.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)