Jump to content

Recommended Posts

Posted
De ce avem nevoie?

Aveti nevoie in primul rand de ZCMD si sscanf

 

Pasul

Adaugati sus de tot in script

#include <zcmd>

#include <sscanf2>

Pasul 2

Aveti nevoie de culoarea rosie

#define COLOR_RED 0xFF0006FF

Pasul 3

Vom folosi enumuri pentru a verifica nivelul de admin

enum PlayerInfo

{

    Adminlevel

}

 

new pInfo[MAX_PLAYERS][PlayerInfo];

Pasul 4

Sa incepem

 

CMD:disarm(playerid, params[])

{

        if(pInfo[playerid][Adminlevel] < 2) return SendClientMessage(playerid, COLOR_RED, "You're not authorized to use this command");//2 is the admin level that can use it 

        new

  string[128],targetid;

if(sscanf(params,"u",targetid)) return SendClientMessage(playerid, -1, "USAGE: /disarm [playerid]");//"u" is the specifier that stands for playername/playerid and -1 is color white 

        format(string,sizeof(string),"Admin %s has disarmed %s",GetName(playerid),GetName(targetid));

        SendClientMessageToAll(COLOR_RED,string);// %s  is the player name 

ResetPlayerWeapons(targetid);//this will reset all player weapons

return 1;

}

 

Aveti nevoie si de stock-ul GetName, adaugati-l jos de tot in script

stock GetName(playerid)

{

new name[24];

GetPlayerName(playerid, name, 24);

return 1;

}

 

Toti specificatorii

 

                                                           By Y_Less

Format          Use

L(true/false)          Optional logical truthity

l                  Logical truthity

B(binary)                  Optional binary number

b                  Binary number

N(any format number)          Optional number

n                  Number

C(character)          Optional character

c                  Character

I(integer)                  Optional integer

i                  Integer

D(integer)                  Optional integer

d                  Integer

H(hex value)          Optional hex number

h                  Hex number

O(octal value)          Optional octal value

o                  Octal value

F(float)           Optional floating point number

f           Floating point number

G(float/INFINITY/-INFINITY/NAN/NAN_E)  Optional float with IEEE definitions

g          Float with IEEE definitions

{          Open quiet section

}          Close quiet section

P<delimiter>  Invalid delimiter change

p<delimiter>          Delimiter change

Z(string)[length]          Invalid optional string

z(string)[length]          Deprecated optional string

S(string)[length]          Optional string

s[length]          String

U(name/id)          Optional user (bot/player)

u          User (bot/player)

Q(name/id)          Optional bot (bot)

q          Bot (bot)

R(name/id)          Optional player (player)

r          Player (player)

A<type>(default)[length]  Optional array of given type

a<type>[length]         Array of given type

E<specification>(default)  Optional enumeration of given layout

e<specification>          Enumeration of given layout

'string'          Search string

%          Deprecated optional specifier prefix

 

 

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

moduri samp