SA-MP Forums Archive
/Drag command - help - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /Drag command - help (/showthread.php?tid=277773)



/Drag command - help - Compton - 19.08.2011

Hello, Well I have a auto /crack command when a player gets shot and gets <30 hp, and he cannot get up, Im wondering how to make a command like /drag [ID], so if you do it the /crakced player will be dragged after you.

-Thanks.


Re: /Drag command - help - =WoR=G4M3Ov3r - 19.08.2011

PHP код:
if(strcmp(cmd"/drag"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if(
PlayerInfo[playerid][pMember] == 1)
            {
                
tmp strtok(cmdtextidx);
                if(!
strlen(tmp)) {
                    
SendClientMessage(playeridCOLOR_WHITE"USAGE: /drag [Playerid/PartOfName]");
                    return 
1;
                }
                
giveplayerid ReturnUser(tmp);
                if(
IsPlayerConnected(giveplayerid))
                {
                    if(
giveplayerid != INVALID_PLAYER_ID)
                    {
                                  if(
giveplayerid == playerid) { SendClientMessage(playeridCOLOR_GREY"You cannot drag yourself!"); return 1; }
                                
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
                                
GetPlayerName(playeridsendernamesizeof(sendername));
                                
GiveNameSpace(giveplayer);
                                
GiveNameSpace(sendername);
                                
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                                
format(stringsizeof(string), "* %s starts dragging %s."sendername ,giveplayer);
                                
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                                
TogglePlayerControllable(giveplayerid0);
                                
DragOff[giveplayerid] = playerid;
                        }
                        else
                        {
                            
SendClientMessage(playeridCOLOR_GREY"   That player is not near you !");
                            return 
1;
                        }
                    }
                }
                else
                {
                    
SendClientMessage(playeridCOLOR_GREY"   That player is Offline !");
                    return 
1;
                }
        }
        return 
1;
    } 



Re: /Drag command - help - KfirRP - 19.08.2011

Quote:
Originally Posted by BATAD
Посмотреть сообщение
PHP код:
if(strcmp(cmd"/drag"true) == 0)
    {
        if(
IsPlayerConnected(playerid))
        {
            if(
PlayerInfo[playerid][pMember] == 1)
            {
                
tmp strtok(cmdtextidx);
                if(!
strlen(tmp)) {
                    
SendClientMessage(playeridCOLOR_WHITE"USAGE: /drag [Playerid/PartOfName]");
                    return 
1;
                }
                
giveplayerid ReturnUser(tmp);
                if(
IsPlayerConnected(giveplayerid))
                {
                    if(
giveplayerid != INVALID_PLAYER_ID)
                    {
                                  if(
giveplayerid == playerid) { SendClientMessage(playeridCOLOR_GREY"You cannot drag yourself!"); return 1; }
                                
GetPlayerName(giveplayeridgiveplayersizeof(giveplayer));
                                
GetPlayerName(playeridsendernamesizeof(sendername));
                                
GiveNameSpace(giveplayer);
                                
GiveNameSpace(sendername);
                                
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                                
format(stringsizeof(string), "* %s starts dragging %s."sendername ,giveplayer);
                                
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                                
TogglePlayerControllable(giveplayerid0);
                                
DragOff[giveplayerid] = playerid;
                        }
                        else
                        {
                            
SendClientMessage(playeridCOLOR_GREY"   That player is not near you !");
                            return 
1;
                        }
                    }
                }
                else
                {
                    
SendClientMessage(playeridCOLOR_GREY"   That player is Offline !");
                    return 
1;
                }
        }
        return 
1;
    } 
You're copying from some LARP. Who said he has ProxDetector and the pInfo?

However perform a public that teleports ID to playerid and SetTimerEx it