Cuffing bug 0.3e
#1

PHP код:
    if(strcmp(cmd"/cuff",true)==0)
        {
            new 
tmp[256];
            new 
message[MAX_STRING];
            if(
PlayerInfo[playerid][power] >= 10 || PlayerInfo[playerid][playerteam]==SASF || PlayerInfo[playerid][playerteam]==COPS || PlayerInfo[playerid][playerteam]==FBI)
            {
            
//{
                
tmp strtok(cmdtextidx);
                if(!
strlen(tmp)){
                    
SendClientUsage(playeridcmd"[Name/ID]");
                    return 
1;
                }
                if(!
IsNumeric(tmp) && (PlayerID(tmp)==-|| PlayerID(tmp)==-1))
                {
                       
SendClientError(playerid,   "Not found. Invalid part of name or more than one result");
                    return 
1;
                }
                if(!
IsNumeric(tmp) && PlayerID(tmp)>=0giveplayerid PlayerID(tmp);
                   if(
IsNumeric(tmp)) giveplayerid strval(tmp);
                   if(!
IsPlayerConnected(giveplayerid))
                   {
                       
SendClientError(playerid,   "Not found.");
                    return 
1;
                }
                if(
giveplayerid==playerid)
                {
                    
SendClientError(playerid,   "You can't cuff yourself!");
                    return 
1;
                }
                if(
Ptazed(giveplayerid)=1))
                   {
                   new 
sender[MAX_STRING];
            if(
PlayerTemp[playerid][hname]==1myStrcpy(sender,"Stranger");
                    if(
PlayerInfo[playerid][playerteam]==SASFformat(message,sizeof(message),"%s cuffed %s",sender,PlayerName(giveplayerid));
                    else 
format(message,sizeof(message),"%s cuffed %s",sender,PlayerName(giveplayerid));
                    
NearMessage(playerid,message,COLOR_ME);
                    
cuffed[giveplayerid]=1;
                    
tazed[giveplayerid]=0;
                    
SetPlayerHealth(giveplayerid,50);
                     
SetPlayerSpecialAction(giveplayeridSPECIAL_ACTION_CUFFED);
                     
SetPlayerAttachedObject(giveplayerid0194186, -0.0110000.028000, -0.022000, -15.600012, -33.699977, -81.7000350.8919991.0000001.168000);
                       
InfoText(giveplayerid,"You have been cuffed",5);
                }
                else 
SendClientError(playerid,   "The player isn't in your vehicle");
            }
            
            return 
1
so, I have a problem with this script, with the "If Ptazed" and I can cuff the player everywhere I want to. I would like to do it that if the player is tazed (PTazed,SPECIAL_ACTION_HANDSUP) on the tazed command. Or that when he is in range.

+rep given to the answer
Reply


Messages In This Thread
Cuffing bug 0.3e - by AlexTm - 20.05.2012, 15:03
Re: Cuffing bug 0.3e - by [FMJ]PowerSurge - 20.05.2012, 15:08
Re: Cuffing bug 0.3e - by AlexTm - 20.05.2012, 19:30

Forum Jump:


Users browsing this thread: 1 Guest(s)