10.11.2009, 04:40
Hello all im having trouble getting my cuff command and medic heal commands working wondering what could be wrong with em thanks for looking.
EDIT: Heal command has been fixed now it`s just the cuff one.
EDIT: Heal command has been fixed now it`s just the cuff one.
Код:
dcmd_cuff(playerid, params[])
{
#pragma unused params
new targetid = strval(params); new CurrentState = GetPlayerState(targetid);
if (!Player[playerid][IsPlayerInGame])
{
SMSpawn; GTFPSpawn; Deny;
return 1;
}
if (strlen(params)==0)
{
SendClientMessage(playerid, PURPLE, "Usage: /cuff targetid."); Deny;
return 1;
}
if (!IsPlayerConnected(targetid))
{
format(MyString, sizeof(MyString), "%i is not a valid player.", targetid); SendCMP; GameTFP;
Deny;
return 1;
}
if (!Coppers(playerid) && !FBI(playerid) && !Army(playerid) && !CIA(playerid))
{
format(MyString, sizeof(MyString), "Only the police can hand cuff!."); SendCMG; GameTFP;
Deny;
return 1;
}
if (GetPlayerWantedLevel(playerid) < 3)
{
format(MyString, sizeof(MyString), "Go hassle some real criminals.", playerid); SendCMP; GameTFP;
Deny;
return 1;
}
if (!NearPlayer(2, playerid, targetid))
{
PNAME; TNAME; Deny;
format(MyString, sizeof(MyString), "%s (%i) is too far away.", TargetName, targetid); GameTFP;
SendClientMessage(playerid, YELLOW, MyString);
return 1;
}
if (CurrentState == PLAYER_STATE_PASSENGER || CurrentState == PLAYER_STATE_DRIVER)
{
format(MyString, sizeof(MyString), "You cannot cuff people in cars.", playerid); SendCMP; GameTFP;
Deny;
return 1;
}
if (targetid == playerid)
{
Deny; SendClientMessage(playerid, PURPLE, "You cannot cuff yourself!");
GameTextForPlayer(playerid, "You cannot cuff yourself!", 3000, 3);
return 1;
}
if (GetPlayerWantedLevel(playerid) > 3 && CurrentState == PLAYER_STATE_ONFOOT)
{
format(MyString, sizeof(MyString), "You have been cuffed.", targetid); SendCMPT; GameTFPT;
DenyT; TPC(targetid, 0); Player[targetid][Cuffed] = 1;
return 1;
}
return 1;
}




