30.08.2012, 20:38
Hello people,I need help with scripting flitterscripts everything i don't know anything about scripting or mapping can some please help me please.I tried the tutorials but still aint working.
Here you will learn to script(CLICK ME CLICK ME CLICK ME)
Go there and learn the basics about scripting,then watch a tutorial here in this forum. Hope i helped. EDIT:The tutorials are supposed to learn you /teach you stuff not give you a free script. |
#include <a_samp> //we include
#include <sscanf2>
#include <zcmd> // the cmd processor that most of samp scripters use
#define OFFLINE SendClientMessage(playerid,-1,"That player is not connected"); // we define this so we dont have to use sendclientmessage all the time.
#define NO_ACCESS SendClientMessage(playerid,-1,"Access Denied"); // same as above
COMMAND:kick(playerid, params[])
{
new id;
if(IsPlayerConnected(id)) // we check if he the selected player is connected(remember the OFFLINE?
{
if(IsPlayerAdmin(playerid)) // if the player is a RCON admin
{
if(!sscanf(params, "u", id)) // if he did not typed an ID
{
new string[900]; // our string
new name[MAX_PLAYER_NAME]; // the players name
new PlayerName[MAX_PLAYER_NAME]; // the victims name
GetPlayerName(playerid, name, sizeof(name)); // we get the players name
GetPlayerName(id, PlayerName, sizeof(PlayerName)); // the victims name
format(string, sizeof(string), "*[Info]You have been kicked by Administrator %s for %s", name,params[2]); // we send to the victim a info message
SendClientMessage(id, -1, string);
format(string, sizeof(string), "*[Info]You kicked %s for %s", PlayerName,params[2]); // we send an info message to the rcon admin
SendClientMessage(playerid,-1, string);
format(string, sizeof(string), "*[Info]Administrator %s kicked %s for %s",name,PlayerName,params[2]);
SendClientMessageToAll(-1, string); // finally we send a message to everyone in the server
GameTextForPlayer(id,"~r~Kicked",5000,1); // in case the player is not looking at the chat or he has it disabled we show him a gametext for 5 seconds
Kick(id); // we kick the player
return 1;
}
else return SendClientMessage(playerid, COLOR_RED, "*[Usage]kick [PlayerId/PartOfName][Reason]"); // if he did not type an id(he can kick without a reason,there is no problem)
}
else return NO_ACCESS // if he is not an admin
}
else return OFFLINE // if the victim is not connected
}