COMMAND:torture(playerid, params[])
{
new giveplayerid;
if(IsPlayerAdmin(playerid))
{
if(sscanf(params, "is[24]", giveplayerid)) return SendClientMessage(playerid,COLOR_YELLOW,"Usage: /torture [PlayerID]");
else
{
SetPlayerPos(playerid, 300.0837,-129.4271,1004.0625);
SetPlayerInterior(playerid, 7);
SetPlayerVirtualWorld(playerid, 0);
TogglePlayerControllable(playerid, 0);
SetPlayerFacingAngle( playerid, 95.22 );
wep1 = CreateDynamicObject(339, 270.5772,-129.6093,1005.6752, 0.0, 0.0, 0.0, -1, -1, -1, 100.0);
MoveDynamicObject(wep1, 300.5394,-129.4422,1004.0625, 1);
SetTimer("torture", 1500, 1);
}
}
return 1;
}
COMMAND:torture(playerid, params[]) { new giveplayerid; if(IsPlayerAdmin(playerid)) { new targetid;//You'll have to make a new variable witch will hold the id of the player you want to torture if(sscanf(params, "u", targetid)) return SendClientMessage(playerid,COLOR_YELLOW,"Usage: /torture [PlayerID]"); else { SetPlayerPos(targetid, 300.0837,-129.4271,1004.0625); SetPlayerInterior(targetid, 7);//Change all of these to targetid becuse you want the targeted id to get tortured SetPlayerVirtualWorld(targetid, 0); TogglePlayerControllable(targetid, 0); SetPlayerFacingAngle(targetid, 95.22 ); wep1 = CreateDynamicObject(339, 270.5772,-129.6093,1005.6752, 0.0, 0.0, 0.0, -1, -1, -1, 100.0); MoveDynamicObject(wep1, 300.5394,-129.4422,1004.0625, 1); SetTimer("torture", 1500, 1);//and SetTimer will start a function after the desired time, i fon't think you want thisbecuse i think you want to torure the player in 15 secounds and then it will stop? if that's true I can help you more, but try the first part first :) } } return 1; }
Specifier(s) Name Example values i, d Integer 1, 42, -10 c Character a, o, * l Logical true, false b Binary 01001, 0b1100 h, x Hex 1A, 0x23 o Octal 045 12 n Number 42, 0b010, 0xAC, 045 f Float 0.7, -99.5 g IEEE Float 0.7, -99.5, INFINITY, -INFINITY, NAN, NAN_E u User name/id (bots and players) ******, 0 q Bot name/id ShopBot, 27 r Player name/id ******, 42
This is how you'll do it,
Код:
COMMAND:torture(playerid, params[]) { new giveplayerid; if(IsPlayerAdmin(playerid)) { new targetid;//You'll have to make a new variable witch will hold the id of the player you want to torture if(sscanf(params, "u", targetid)) return SendClientMessage(playerid,COLOR_YELLOW,"Usage: /torture [PlayerID]"); else { SetPlayerPos(targetid, 300.0837,-129.4271,1004.0625); SetPlayerInterior(targetid, 7);//Change all of these to targetid becuse you want the targeted id to get tortured SetPlayerVirtualWorld(targetid, 0); TogglePlayerControllable(targetid, 0); SetPlayerFacingAngle(targetid, 95.22 ); wep1 = CreateDynamicObject(339, 270.5772,-129.6093,1005.6752, 0.0, 0.0, 0.0, -1, -1, -1, 100.0); MoveDynamicObject(wep1, 300.5394,-129.4422,1004.0625, 1); SetTimer("torture", 1500, 1);//and SetTimer will start a function after the desired time, i fon't think you want thisbecuse i think you want to torure the player in 15 secounds and then it will stop? if that's true I can help you more, but try the first part first :) } } return 1; } ![]() |
SetTimerEx("SetPlayerHealth", 1500, false , "if", targetid, 0.0);
Change the timer to
Код:
SetTimerEx("SetPlayerHealth", 1500, false , "if", targetid, 0.0); ![]() |
new wep1;//set this at the start of your gamemode before OnGameModeInit(); //and then you could do that timer, but not exactly like you whrite it, do it like this. SetTimerEx("DestroyDynamicObject", 1500, false , "i", wep1);