28.03.2013, 23:21
(
Последний раз редактировалось Humprabbit; 29.03.2013 в 00:14.
)
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:
Cheers Rhys,
The problem is it doesn't drag the person at all...
Here is the code:
PHP код:
command(stopdrag, playerid, params[])
{
#pragma unused params
new string[73], dragtimer;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnectedEx(i))
{
format(string, sizeof(string), "* %s has stopped dragging %s.", GetName(playerid), GetName(i));
NearByMessage(playerid, NICESKY, string);
KillTimer(dragtimer);
}
}
return 1;
}
new dragtimer;
command(drag, playerid, params[])
{
new id, string[128], dragtimer;
if(sscanf(params, "u", id))
{
SendClientMessage(playerid, WHITE, "SYNTAX: /drag [playerid]");
}
else
{
if(Player[id][Tied] >= 1 || Player[id][Cuffed] >= 1)
{
if(GetDistanceBetweenPlayers(playerid, id) < 7)
{
format(string, sizeof(string), "You have started to drag %s.", GetName(id));
SendClientMessage(playerid, WHITE, string);
format(string, sizeof(string), "* %s grabs ahold of %s and starts dragging them.", GetName(playerid), GetName(id));
NearByMessage(playerid, NICESKY, string);
dragtimer = SetTimerEx("drag", 1000, true, "i", playerid);
}
else
{
SendClientMessage(playerid, WHITE, "You're too far away!");
}
}
else
{
SendClientMessage(playerid, WHITE, "Your target has to be either tied or cuffed.");
}
}
return 1;
}
forward drag(playerid, params[]);
public drag(playerid, params[])
{
new id, string[128];
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(id,x, y, z);
}