Ok i now i make a kick cmd and it says "You are not authorized to use this cmd" why...
PHP код:
********************************************************************************
GRAND THEFT AUTO ROLEPLAY PROJECT
********************************************************************************
INCLUDES
*******************************************************************************/
#include <a_samp>
#include <zcmd>
#include <sscanf>
#include <YSI\y_ini>
/********************************************************************************
DEFINES
*******************************************************************************/
#define COLOR_SUCCESS 0x33CCFFAA
#define COLOR_DO-ME 0xC2A2DA00
#define COLOR_S-C-B-OOC 0xE0FFFFAA
#define COLOR_ADMINCHAT 0x8080FFFF
#define COLOR_GANGCHAT 0xF4A419FF
#define COLOR_FAMILYCHAT 0x00FFFFFF
#define COLOR_ADVERTISE 0x33AA3300
#define COLOR_MOLE-TXT-MEGAPHONE 0xFFFF00AA
#define COLOR_GOV-AGOV 0x2641FE00
#define COLOR_ALLDEPT 0xFF828200
#define COLOR_CORRECTION 0xB4B5B7FF
#define COLOR_LIGHTRED 0xFF6347AA
/********************************************************************************
STOCK DE CHATS
*******************************************************************************/
stock SendRangedMessage(sourceid, color, message[], Float:range) {
new Float:x, Float:y, Float: z;
GetPlayerPos(sourceid, x, y, z);
for (new ii = 0; ii < MAX_PLAYERS; ii++) {
if(GetPlayerVirtualWorld(sourceid) == GetPlayerVirtualWorld(ii)) {
if(IsPlayerInRangeOfPoint(ii, range, x, y, z)) {
SendClientMessage(ii, color, message);
}
}
}
}
/*******************************************************************************
ADMIN RANK NAMES
*******************************************************************************/
enum aInfo
{
pAdmin
}
new PlayerInfo[MAX_PLAYERS][aInfo];
stock GetAdminRank(playerid)
{
new arank[64];
switch(PlayerInfo[playerid][pAdmin])
{
case 6: arank = "Server Owner";
case 5: arank = "Head Admin";
case 4: arank = "Management";
case 3: arank = "Chief Moderator";
case 2: arank = "Class 2 Moderator";
case 1: arank = "Moderator";
default: arank = "None";
}
return arank;
}
stock SendAdminMessage(col, string[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][pAdmin] > 0)
SendClientMessage(i, col, string);
}
return 1;
}
main()
{
print("\n~~~~~~~~~~~~~~~~~~~~~~~~~~~");
print("~ ~");
print("~ WELCOME MR. UGAS ~");
print("~ ~");
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
}
public OnGameModeInit()
{
SetGameModeText("Light Roleplay");
UsePlayerPedAnims(); // ESTILO DE CORRER NORMAL
DisableInteriorEnterExits(); // QUITAR FLECHA AMARILLA DE ENTRADA Y SALIDA
EnableStuntBonusForAll(0); //QUITAR BONIFICACION POR ACROBACIA 0 PARA DESHABILITAR 1 PARA HABILITAR
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
/*******************************************************************************
LSPD VEHICLES
*******************************************************************************/
AddStaticVehicle(523,1527.3163,-1685.1029,5.4608,271.5119,0,1);
AddStaticVehicle(523,1527.5216,-1682.6748,5.4604,272.3541,0,1);
AddStaticVehicle(523,1596.7095,-1711.5623,5.4607,1.0969,0,1);
AddStaticVehicle(523,1594.4382,-1711.6831,5.4607,1.6969,0,1);
AddStaticVehicle(599,1585.2042,-1671.6952,6.1334,270.4819,0,1);
AddStaticVehicle(599,1585.1556,-1667.5024,6.1309,270.3976,0,1);
AddStaticVehicle(596,1601.7969,-1683.9301,5.6154,89.1779,0,1);
AddStaticVehicle(596,1601.7103,-1687.9463,5.6154,88.7239,0,1);
AddStaticVehicle(596,1601.6028,-1692.1003,5.6155,89.4667,0,1);
AddStaticVehicle(596,1601.5330,-1696.1677,5.6163,89.7926,0,1);
AddStaticVehicle(596,1601.4321,-1700.2527,5.6159,90.3063,0,1);
AddStaticVehicle(596,1601.3737,-1704.3434,5.6166,88.8093,0,1);
AddStaticVehicle(596,1591.6672,-1710.2681,5.6114,0.1604,0,1);
AddStaticVehicle(596,1587.4830,-1710.3685,5.6157,1.1158,0,1);
AddStaticVehicle(596,1583.3774,-1710.4376,5.6166,0.6561,0,1);
AddStaticVehicle(596,1578.5658,-1710.4767,5.6166,359.4766,0,1);
AddStaticVehicle(596,1574.4263,-1710.4875,5.6152,359.8694,0,1);
AddStaticVehicle(596,1570.2677,-1710.5610,5.5683,0.5529,0,1);
AddStaticVehicle(427,1564.6061,-1710.8301,6.0496,0.6901,0,1);
AddStaticVehicle(523,1559.8895,-1710.8851,5.4632,357.4979,0,1);
AddStaticVehicle(523,1557.4730,-1712.1764,5.4604,5.0780,0,1);
AddStaticVehicle(596,1528.7706,-1687.9839,5.6145,269.6358,0,1);
AddStaticVehicle(596,1544.3862,-1684.3945,5.6158,89.1681,0,1);
AddStaticVehicle(596,1544.5164,-1680.3345,5.6153,89.9007,0,1);
AddStaticVehicle(596,1544.6355,-1676.2106,5.6159,89.6448,0,1);
AddStaticVehicle(596,1544.7999,-1672.1379,5.5521,88.9068,0,1);
AddStaticVehicle(596,1544.9031,-1667.8500,5.6150,89.7383,0,1);
AddStaticVehicle(596,1544.9717,-1663.1096,5.5480,89.7992,0,1);
AddStaticVehicle(596,1545.0317,-1659.1681,5.5494,89.8932,0,1);
AddStaticVehicle(596,1545.1237,-1655.1316,5.5508,89.4096,0,1);
AddStaticVehicle(596,1545.2240,-1651.0857,5.6151,89.2011,0,1);
AddStaticVehicle(528,1538.6281,-1644.6017,5.8624,181.3446,0,1);
AddStaticVehicle(528,1534.6387,-1644.6354,5.8654,181.2640,0,1);
AddStaticVehicle(601,1530.5455,-1644.7382,5.6868,180.6024,0,1);
AddStaticVehicle(601,1526.4720,-1644.5981,5.6867,179.1370,0,1);
AddStaticVehicle(497,1561.5265,-1657.4136,28.5733,90.2463,0,0);
AddStaticVehicle(497,1551.5613,-1644.3290,28.5232,88.7546,0,0);
AddStaticVehicle(497,1552.5212,-1706.2377,28.5715,87.8549,0,0);
AddStaticVehicle(497,1561.3627,-1691.7267,28.5730,90.6360,0,0);
/*******************************************************************************
FBI VEHICLES
*******************************************************************************/
AddStaticVehicle(490,1761.6815,-1660.3876,13.6885,90.0116,0,0);
AddStaticVehicle(490,1761.7026,-1664.3705,13.6885,89.9007,0,0);
AddStaticVehicle(490,1761.7349,-1668.5120,13.6891,90.6184,0,0);
AddStaticVehicle(415,1762.1243,-1672.9875,13.3860,89.9096,0,0);
AddStaticVehicle(415,1762.1129,-1676.4563,13.3834,89.5654,0,0);
AddStaticVehicle(415,1762.1403,-1680.0005,13.3939,89.6049,0,0);
AddStaticVehicle(451,1764.1061,-1640.6316,14.1184,125.3097,0,0);
AddStaticVehicle(447,1783.0109,-1647.6302,39.1222,129.6716,0,0);
AddStaticVehicle(447,1793.9280,-1663.9199,39.1218,128.4076,0,0);
AddStaticVehicle(497,1790.1617,-1655.4030,39.2861,125.9664,0,0);
/*******************************************************************************
SAMFD VEHICLES
*******************************************************************************/
AddStaticVehicle(416,1181.4211,-1308.7296,13.8054,271.3664,1,3);
AddStaticVehicle(416,1181.8961,-1338.8051,13.8854,269.0506,1,3);
AddStaticVehicle(407,1211.2191,-1323.5789,13.7093,359.3416,3,1);
AddStaticVehicle(407,2038.4838,-1419.7720,17.3101,181.2136,3,1);
AddStaticVehicle(416,2016.2207,-1412.3525,17.1424,181.2251,1,3);
AddStaticVehicle(416,2010.9615,-1412.3804,17.1424,179.8213,1,3);
AddStaticVehicle(416,2005.8264,-1412.4191,17.1424,180.6365,1,3);
AddStaticVehicle(563,2055.7993,-1416.5199,49.0409,88.5873,3,1);
AddStaticVehicle(563,2058.0964,-1431.6517,49.0416,90.3616,3,1);
AddStaticVehicle(563,1159.8182,-1318.3346,32.2016,267.5297,3,1);
AddStaticVehicle(563,1159.3705,-1304.5052,32.2030,270.9046,3,1);
/*******************************************************************************
SANews VEHICLES
*******************************************************************************/
AddStaticVehicle(488,741.9053,-1371.1826,25.8690,0.1854,1,2);
AddStaticVehicle(582,754.9459,-1334.9719,13.5945,181.4745,1,2);
AddStaticVehicle(582,759.5004,-1334.8759,13.6002,181.9060,1,2);
AddStaticVehicle(582,764.1581,-1334.9065,13.5960,179.8305,1,2);
AddStaticVehicle(582,768.5367,-1334.7930,13.5959,180.3463,1,2);
AddStaticVehicle(582,781.9040,-1343.5404,13.5914,89.6859,1,2);
AddStaticVehicle(582,781.8544,-1348.7742,13.5929,89.9967,1,2);
AddStaticVehicle(582,781.9462,-1354.2291,13.5944,90.7076,1,2);
AddStaticVehicle(488,735.5504,-1371.2444,25.8669,358.6932,1,2);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerConnect(playerid)
{
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
{
// Do something here
return 1;
}
return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
return 1;
}
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}
public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}
public OnPlayerUpdate(playerid)
{
return 1;
}
public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}
public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}
public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
/*******************************************************************************
CHATS
*******************************************************************************/
CMD:ooc(playerid, params[])
{
new sendername[MAX_PLAYER_NAME], string[56];
GetPlayerName(playerid, sendername, sizeof(sendername));
if(isnull(params)) return SendClientMessage(playerid, COLOR_CORRECTION,"USAGE: (/o)oc [Out-of-Character Chat]");
format(string, sizeof(string), "(( %s: %s ))", sendername, params);
SendClientMessageToAll(COLOR_S-C-B-OOC, string);
return 1;
}
CMD:o(playerid, params[])
{
return cmd_ooc(playerid, params);
}
CMD:b(playerid, params[])
{
new sendername[MAX_PLAYER_NAME], string[56];
GetPlayerName(playerid, sendername, sizeof(sendername));
if(isnull(params)) return SendClientMessage(playerid, COLOR_CORRECTION, "USAGE: /b [Local OOC Chat]");
format(string, sizeof(string), "%s Says: (( %s ))", sendername, params);
SendRangedMessage(playerid, COLOR_S-C-B-OOC, string, 20);
return 1;
}
CMD:close(playerid, params[])
{
new sendername[MAX_PLAYER_NAME], string[56];
GetPlayerName(playerid, sendername, sizeof(sendername));
if(isnull(params)) return SendClientMessage(playerid, COLOR_CORRECTION, "USAGE: /©lose [Close Chat Text]");
format(string, sizeof(string), "%s Says: %s", sendername, params);
SendRangedMessage(playerid, COLOR_S-C-B-OOC, string, 3);
return 1;
}
CMD:c(playerid, params[])
{
return cmd_close(playerid, params);
}
CMD:shout(playerid, params[])
{
new sendername[MAX_PLAYER_NAME], string[56];
GetPlayerName(playerid, sendername, sizeof(sendername));
if(isnull(params)) return SendClientMessage(playerid, COLOR_CORRECTION, "USAGE: (/s)hout [Local Chat]");
format(string, sizeof(string), "%s Shouts: %s!", sendername, params);
SendRangedMessage(playerid, COLOR_S-C-B-OOC, string, 25);
return 1;
}
CMD:s(playerid, params[])
{
return cmd_shout(playerid, params);
}
CMD:me(playerid, params[])
{
new sendername[MAX_PLAYER_NAME], string[56];
GetPlayerName(playerid, sendername, sizeof(sendername));
if(isnull(params)) return SendClientMessage(playerid, COLOR_CORRECTION, "USAGE: /me [Action]");
format(string, sizeof(string), "* %s %s *", sendername, params);
SendRangedMessage(playerid, COLOR_DO-ME, string, 30);
return 1;
}
CMD:do(playerid, params[])
{
new sendername[MAX_PLAYER_NAME], string[56];
GetPlayerName(playerid, sendername, sizeof(sendername));
if(isnull(params)) return SendClientMessage(playerid, COLOR_CORRECTION, "USAGE: /do [Action]");
format(string, sizeof(string), "** %s %s **", sendername, params);
SendRangedMessage(playerid, COLOR_DO-ME, string, 30);
return 1;
}
CMD:adminchat(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new text[128];
if(sscanf(params, "s[128]",text)) return SendClientMessage(playerid, COLOR_CORRECTION, "USAGE: (/a)dmin [Admin Chat]");
format(text, sizeof(text), "%s %s: %s",GetAdminRank(playerid), name, text);
SendAdminMessage(COLOR_ADMINCHAT, text);
}
else
{
SendClientMessage(playerid, COLOR_CORRECTION, "You are not authorized to use this chat.");
}
return 1;
}
CMD:a(playerid, params[])
{
return cmd_adminchat(playerid, params);
}
CMD:kick(playerid,params[])
{
new id,name1[MAX_PLAYER_NAME],name2[MAX_PLAYER_NAME];
if(!PlayerInfo[playerid][pAdmin] >= 1) return SendClientMessage(playerid, COLOR_CORRECTION,"You are not authorized to use this command.");
if(sscanf(params,"us[128]",id,params)) return SendClientMessage(playerid, COLOR_CORRECTION,"USAGE: /kick [Playerid/Partofname] [Reason]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_CORRECTION,"Player is not connected");
GetPlayerName(playerid,name1,sizeof(name1));
GetPlayerName(id,name2,sizeof(name2));
format(params,129, "Notice: %s was kicked by %s, reason: %s (%d-%d-%d)",name2,name1,params);
SendClientMessageToAll(COLOR_LIGHTRED,params);
Kick(id);
return 1;
}