SA-MP Forums Archive
Freeze/surrender command - 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: Freeze/surrender command (/showthread.php?tid=195338)



Freeze/surrender command - [JnA]DukeNukem - 02.12.2010

Hello guys,i was wondering how i can apply the 'surrender' animation,and how to make it normal(no animation using a command?

Thanks


Re: Freeze/surrender command - iggy1 - 02.12.2010

I think i know what you mean by surrender i might be wrong. You press enter to clear it.
pawn Код:
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_HANDSUP);



Re: Freeze/surrender command - [JnA]DukeNukem - 02.12.2010

I want to type '/freeze [player id]' that player freezes(cant move) and only the person that has frozen that player can unfreeze.

Can i use 'toggleplayercontrolable'?


Re: Freeze/surrender command - iggy1 - 02.12.2010

Yes use TogglePlayerControllable(playerid, false); to freeze.


Re: Freeze/surrender command - [JnA]DukeNukem - 02.12.2010

Also i have 1 more question..... Lets say i /cuff a player, i want the cuffed player to freeze if he gets to far away from me.how?


Re: Freeze/surrender command - Think - 02.12.2010

Quote:
Originally Posted by [JnA]DukeNukem
Посмотреть сообщение
Also i have 1 more question..... Lets say i /cuff a player, i want the cuffed player to freeze if he gets to far away from me.how?
Create a timer and get your pos and the other players pos and use IsPlayerInRangeOfPoint to check if he is in range, if not > TogglePlayerControlable


Re: Freeze/surrender command - [JnA]DukeNukem - 02.12.2010

Could you post an example timer(never really used timers)?
thanks


Re: Freeze/surrender command - iggy1 - 02.12.2010

Quote:
Originally Posted by [JnA]DukeNukem
Посмотреть сообщение
Could you post an example timer(never really used timers)?
thanks
Maybe you should be advertising that you make gamemodes for cash if you don't even know how a timer or TogglePlayerControllable works.


Re: Freeze/surrender command - Think - 02.12.2010

Quote:
Originally Posted by [JnA]DukeNukem
Посмотреть сообщение
Could you post an example timer(never really used timers)?
thanks
pawn Код:
new freezetimer;
forward TimerExample(playerid);
public TimerExample(playerid)
{
 GetPlayerPos(playerid);
 return 1;
}

if(!strcmp("/arrest", cmdtext, true))
{
 freezetimer = SetTimerEx("TimerExample", 500, 1, "d", playerid);
}

if(!strcmp("/lawl", cmdtext, true))
{
 DestroyTimer(freezetimer);
}
Something like this will do just fine (of course you need to get the ID and stuff but it'll work


Re: Freeze/surrender command - iggy1 - 02.12.2010

Quote:
Originally Posted by iggy1
Посмотреть сообщение
Maybe you should be advertising that you make gamemodes for cash if you don't even know how a timer or TogglePlayerControllable works.
Use search, there are plenty of tutorials on timers. Also look on the wiki. Posting here should be a last resort.

EDIT: Sorry not been up long still tierd, i didn't mean to have a go.