01.02.2014, 02:02
Well since I'm converting to zcmd,sscanf and since the commands then arent under OnPlayerCommandText I have this question.. Can I still leave this under that callback?
EDIT: Yes I will remove the things that isnt needed there, I just copy pasted right now..
pawn Код:
new string[512 char];
new playermoney;
new sendername[MAX_PLAYER_NAME];
new giveplayer[MAX_PLAYER_NAME];
new playername[MAX_PLAYER_NAME];
new cmd[128];
new tmp[128];
new dancestyle;
new giveplayerid, moneys, idx;
new idcar = GetPlayerVehicleID(playerid);
new pveh = GetVehicleModel(GetPlayerVehicleID(playerid));
cmd = strtok(cmdtext, idx);
GetPlayerName(playerid, sendername, sizeof(sendername));
new y5, m5, d5;
new h5,mi5,s5;
getdate(y5,m5,d5);
gettime(h5,mi5,s5);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> %s",d5,m5,y5,h5,mi5,s5,sendername,cmdtext);
AllCommandLog(string);
if(PlayerInfo[playerid][pAdmin] == 0) Commands[playerid] ++;
if(Commands[playerid] >= 1)
{
KillTimer(CommandsTimer[playerid]);
CommandsTimer[playerid] = SetTimerEx("ResetCommands",1500,false,"i",playerid);
}
if(Commands[playerid] == 5) SCM(playerid, COLOR_LIGHTBLUE,"* Slow it down or you will be kicked!");
if(Commands[playerid] == 10)
{
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "%s (%d), Has been kicked by The [AC] for Flooding the Commands.", playername, playerid);
SCMToAll(COLOR_NICERED, string);
SCM(playerid,COLOR_LIGHTBLUE, "You have been Kicked by The [AC] For Flooding the commands.");
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] [AC] Has Kicked %s for: Flooding the Commands.",d5,m5,y5,h5,mi5,s5,playername);
KickLog(string);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] Kicked by the [AC] - Flooding the Commands.",d5,m5,y5,h5,mi5,s5,playername);
AddPunishment(playerid, string);
SetTimerEx("KickPlayerOut",500,false,"i",playerid);
KillTimer(CommandsTimer[playerid]);
}
if(PlayerInfo[playerid][pAdmin] >= 1 && AFK[playerid] == 1)
{
if(!IsPlayerInAnyVehicle(playerid)) SafeSetPlayerPos(playerid, TeleportDest[playerid][0],TeleportDest[playerid][1],TeleportDest[playerid][2]);
else SetVehiclePos(idcar, TeleportDest[playerid][0],TeleportDest[playerid][1],TeleportDest[playerid][2]);
afkadmins --;
AFK[playerid] = 0;
TogglePlayerControllable(playerid, 1);
TextDrawHideForPlayer(playerid, Textdraw5);
TextDrawHideForPlayer(playerid, Textdraw50);
TextDrawShowForPlayer(playerid, Textdraw44);
TextDrawShowForPlayer(playerid, Textdraw45);
TextDrawShowForPlayer(playerid, Textdraw49[playerid]);
TextDrawShowForPlayer(playerid, Textdraw51[playerid]);
TextDrawShowForPlayer(playerid, Textdraw55);