11 Juni, 2012

PAWNO Programming | A kick command with mirror system for SA-MP.

Hallo guys..
Today I'm going to show you the tutorial of Kick Command, okay let's prepare the materials first.
ZCMDsscanf, then a_samp.
Okay now types this on top of your script
#include <a_samp>
#include <Zcmd>
#include <sscanf>
As I was told you before, these means we've added plugins into your server, let's go on
Okay let's type this after that one
enum pDetails{
         Admin
};
new pInfo[MAX_PLAYERS][pDetails];


Type this on bottom of your script

CMD:kick(playerid, params[])
{
       new targetid, reason, msg[240], name[MAX_PLAYER_NAME], aname[MAX_PLAYER_NAME];
       if(sscanf(params, "us", id, reason)) return SendClientMessage(playerid, [YOURCOLOR], "COMMAND: /kick [playerid] [reason]");
       if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, [YOURCOLOR], "COMMAND: Player doesn't connect");

Those words means, if the ID's wrong or invalid ID, they gonna eject the acess
Okay let's continue this script

       if(pInfo[playerid][Admin] < pInfo[id][Admin])
       {
                SendClientMessage(playerid, [YOUR COLOR], "MIRROR: Trying to kick higher admin level");
                Kick(playerid);
       }

Nah this is the MIRROR, if the level of id higher that the player id or the commander, they'll continue the acess of command, but it goes to the commander oir playerid

       else
       {
                 GetPlayerName(playerid, aname, sizeof(aname));
                 GetPlayerName(id, name, sizeof(name));
                 format(msg, 240, "Administrator %s has just kicked %s, with reason: %s", aname, name, reason);
                 SendClientMessageToAll([YOURCOLOR], msg);
                 Kick(id);
        }
    return 1;
}

Nah this is the last, it'll kick your target, then infrom all players about this news.
Then this's the complete parts

#include <a_samp>
#include <Zcmd>
#include <sscanf>
enum pDetails{
         Admin
};
new pInfo[MAX_PLAYERS][pDetails];

CMD:kick(playerid, params[])
{
       new targetid, reason, msg[240], name[MAX_PLAYER_NAME], aname[MAX_PLAYER_NAME];
       if(sscanf(params, "us", id, reason)) return SendClientMessage(playerid, [YOURCOLOR], "COMMAND: /kick [playerid] [reason]");
       if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, [YOURCOLOR], "COMMAND: Player doesn't connect");
        if(pInfo[playerid][Admin] < pInfo[id][Admin])
       {
                SendClientMessage(playerid, [YOUR COLOR], "MIRROR: Trying to kick higher admin level");
                Kick(playerid);
       }
        else
       {
                 GetPlayerName(playerid, aname, sizeof(aname));
                 GetPlayerName(id, name, sizeof(name));
                 format(msg, 240, "Administrator %s has just kicked %s, with reason: %s", aname, name, reason);
                 SendClientMessageToAll([YOURCOLOR], msg);
                 Kick(id);
        }
    return 1;
}


Okay that's all what i want to share with you guys today, see you later then have good luck ;)
See you later, in next discussion :D

Best regards, Ryu

09 Juni, 2012

How to play Grand Theft Auto: San Andreas IN ONLINE

Hallo guys..
Today I'll tell you how to play GTA SA in online, online means multiplayer so you'll not meet a BOT like in offline. Okay let's go.

If you want to play it in online, first you must have GTA San Andreas files, it's like GTA_SA.exe and the others. Alright next material is SAMP setup, you can download it over HERE .

Alright, you must run the setup, then install it. You can follow the instruction from the setup..

I hope you guys how don't know about San Adreas Multiplayer, play it now..
Okay guys that's all I want to share with you now, next post might be An Admin command in SAMP Server, see you. Big thanks for all of SA-MP crews cause those guys have been created it.

Best Regrads, Ryu.

PAWNO Programming | A simple admin script for SA-MP.

Hallo guys..

Where ever you're, hope you're in fine condition, okay let's go to the point.

In this script, we need ZCMD , sscanf , and a_samp absolutely, haha.

Okay let's begin...

firstly, you must type this on top of your script

#include <a_samp>
#include <Zcmd>
#include <sscanf>

Okay we've included the plugins, and then type this under of that words

enum pDetails {
       Admin
};
new pInfo[MAX_PLAYERS][pDetails];

Alright now, we can create the CMDs. Type this on bottom of your script

CMD:setadmin(playerid, params[])
{
      new id, level, msg[240], aname[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME];
      if(sscanf(params, "ud", id, level)) return SendClientMessage(playerid, [YOUR COLOR], "COMMAND: /setadmin [playerid] [level]");


It means you've set how the command gonna work, so they shall get your target id by the numbers you've typed, and the level too. Okay let's continue this.

     if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, [YOURCOLOR], "COMMAND: Player doesn't connect");

It means, if your target hasn't connect they'll denied your command following that reason, okay go on.

   if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, [YOURCOLOR], "COMMAND: You're not an admin");

Okay I'll explain it. It means only RCON Admin can acess this command, so you must logged in as an admin to promote someone.

    else
    {
           GetPlayerName(playerid, aname, sizeof(aname));
           GetPlayerName(id, name, sizeof(name));
           format(msg, sizeof(msg), "Administrator %s has just promoted %s[%d] to be an admin level %d", aname, name, id, level);
           SendClientMessageToAll([YOURCOLOR], msg);
           pInfo[id][Admin] = level;
    }
  return 1;
}

Okay I'm going to explain it guys, haha. It means this part gonna get your name, and your target name too. Then it'll inform all players about this news, then set your target being an admin quickly :D

In complete parts

CMD:setadmin(playerid, params[])
{
      new id, level, msg[240], aname[MAX_PLAYER_NAME], name[MAX_PLAYER_NAME];
      if(sscanf(params, "ud", id, level)) return SendClientMessage(playerid, [YOUR COLOR], "COMMAND: /setadmin [playerid] [level]");
       if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, [YOURCOLOR], "COMMAND: Player doesn't connect");
       if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, [YOURCOLOR], "COMMAND: You're not an admin");
       else
      {
           GetPlayerName(playerid, aname, sizeof(aname));
           GetPlayerName(id, name, sizeof(name));
           format(msg, sizeof(msg), "Administrator %s has just promoted %s[%d] to be an admin level %d", aname, name, id, level);
           SendClientMessageToAll([YOURCOLOR], msg);
           pInfo[id][Admin] = level;
      }
  return 1;
}

At last you've done a CMD, okay guys thanks for visiting my blog, i'll post the other CMD, see you.
Byee...

Best regrads, Ryu