[Tutorial] A Simple /freeze command for admins
#1

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.
Reply
#2

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.
Reply
#3

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

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

lol
and after freezing him how to unfreeze him ? :3
Reply
#6

Pathetic excuse for a "tutorial".
Reply
#7

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

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
Reply
#9

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

how to unfreeze him? help pls someone?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)