SA-MP Forums Archive
[Tutorial] A Simple /freeze command for admins - 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: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] A Simple /freeze command for admins (/showthread.php?tid=523058)



A Simple /freeze command for admins - Puff - 30.06.2014

Step 1: Open Pawno.exe

Step 2: On the first lines add this code

PHP Code:
#include <zcmd>
#define SCM SendClientMessage 
new Freeze[MAX_PLAYERS];

Step 3:

After adding all the defines and includes add this code

PHP Code:
COMMAND:freeze(playerid,params[])
{
    new 
id;
    new 
Admin[24];
    new 
string[256];
    
GetPlayerName(playerid,Admin,24);
    if(
PlayerInfo[playerid][pAdminLevel] <2) return SCM(playerid,COLOR,"(  ! ) You need to bee level 2");
    if(
sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_GREY,"USE:/freeze [id]");
    if(
Freeze[id] == 1) return SCM(playerid,COLOR,"( ! ) Player is alerty frozen");
    if(!
IsPlayerConnected(id)) return SCM(playeridCOLOR"( ! ) Player not connected");
    
TogglePlayerControllable(id,0);
    
Freeze[id] =1;
    
format(string,sizeof(string),"( ! ) Admin %s freeze u ",Admin);
    
SCM(id,COLOR,string);
    return 
1;

I hope this thread will help you.


Re: A Simple /freeze command for admins - LivingLikeYouDo - 30.06.2014

And then where did we define PlayerInfo enum? How to unfreeze players?

These would be the common questions you are about to get.
Also, why are you using a string as big as 256 for such a format?

Stop copy/pasting, and first learn what you are doing then continue over it.


Re: A Simple /freeze command for admins - Beckett - 03.07.2014

Sorry but this isn't a tutorial it's "How to copy-paste".


Re: A Simple /freeze command for admins - kirostar - 03.07.2014

Copy-Paste, and.. where is the playerinfo enum?


Re: A Simple /freeze command for admins - Frankin - 04.07.2014

lol
and after freezing him how to unfreeze him ? :3


Re: A Simple /freeze command for admins - NoahF - 06.07.2014

Pathetic excuse for a "tutorial".


Re: A Simple /freeze command for admins - eXeDev - 06.07.2014

This isn't a tutorial at all, you're just providing awfully written code.


Re: A Simple /freeze command for admins - SkillNasr - 16.08.2014

Quote:
Originally Posted by Frankin
View Post
lol
and after freezing him how to unfreeze him ? :3
Haha you let em freezed all his life


Re: A Simple /freeze command for admins - Hwang - 20.08.2014

If the error is added to the data:
pawn Code:
#define COLOR (-1)



Re: A Simple /freeze command for admins - AndreiWow - 18.11.2014

how to unfreeze him? help pls someone?