/Drag command.
#1

Hey guys, I'm probably being really dumb with this... but anybody who can help would be much appreciated
The problem is it doesn't drag the person at all...
Here is the code:
PHP код:
command(stopdragplayeridparams[])
{
    
#pragma unused params
    
    
new string[73], dragtimer;
    
    for(new 
0MAX_PLAYERSi++)
    {
        if(
IsPlayerConnectedEx(i))
        {
            
format(stringsizeof(string), "* %s has stopped dragging %s."GetName(playerid), GetName(i));
             
NearByMessage(playeridNICESKYstring);
             
KillTimer(dragtimer);
        }
    }
    
    return 
1;
}
new 
dragtimer;
command(dragplayeridparams[])
 {
    new 
idstring[128], dragtimer;
    if(
sscanf(params"u"id))
    {
        
SendClientMessage(playeridWHITE"SYNTAX: /drag [playerid]");
    }
    else
    {
        if(
Player[id][Tied] >= || Player[id][Cuffed] >= 1)
        {
            if(
GetDistanceBetweenPlayers(playeridid) < 7)
            {
            
format(stringsizeof(string), "You have started to drag %s."GetName(id));
                
SendClientMessage(playeridWHITEstring);
                
format(stringsizeof(string), "* %s grabs ahold of %s and starts dragging them."GetName(playerid), GetName(id));
                
NearByMessage(playeridNICESKYstring);
            
dragtimer SetTimerEx("drag"1000true"i"playerid);
            }
            else
            {
                
SendClientMessage(playeridWHITE"You're too far away!");
            }
        }
        else
        {
            
SendClientMessage(playeridWHITE"Your target has to be either tied or cuffed.");
        }
    }
    return 
1;
}
forward drag(playeridparams[]);
public 
drag(playeridparams[])
{
           new 
idstring[128];
        new 
Float:xFloat:yFloat:z;
        
GetPlayerPos(playeridxyz);
        
SetPlayerPos(id,xyz);

Cheers Rhys,
Reply


Messages In This Thread
/Drag command. [Fixed] - by Humprabbit - 28.03.2013, 23:21
Re: /Drag command. - by zxc1 - 28.03.2013, 23:46
Re: /Drag command. - by Humprabbit - 29.03.2013, 00:13

Forum Jump:


Users browsing this thread: 1 Guest(s)