/cleanchat cmd (rep +) -
Geeboi_Mehdi - 30.08.2012
i use ppc Cmds So here is a Cmd from ppc Also i want it to be level 1 Admin
Cmd:
pawn Код:
// Gives the player the cash he requests
COMMAND:cash(playerid, params[])
{
new Amount, Msg[128];
// Send the command to all admins so they can see it
SendAdminText(playerid, "/cash", params);
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Check if the player's admin-level is at least 4
if (APlayerData[playerid][PlayerLevel] >= 4)
{
if (sscanf(params, "i", Amount)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/cash <amount>\"");
else
{
// Check if the player gave himself too much at once
if (Amount > 10000000)
{
// Inform the player and quit the command
SendClientMessage(playerid, 0xFF0000AA, "You cannot give yourself more than 10M at once");
return 1;
}
// Reward the player (give cash and points)
RewardPlayer(playerid, Amount, 0);
format(Msg, 128, "You have earned $%i", Amount);
SendClientMessage(playerid, 0x00FF00AA, Msg);
}
}
else
return 0;
}
else
return 0;
return 1;
}
Re: /cleanchat cmd (rep +) -
ThePrograme - 30.08.2012
If you want to be an admin level 1 you got to make a make admin command. +rep
Re: /cleanchat cmd (rep +) -
EliteDrive - 30.08.2012
Soo /clearchat or /cash?
pawn Код:
command(clearchat, playerid, params[])
{
if(Player[playerid][AdminLevel] >= 3)
{
SendClientMessageToAll(WHITE, " ");
SendClientMessageToAll(WHITE, " ");
SendClientMessageToAll(WHITE, " ");
SendClientMessageToAll(WHITE, " ");
SendClientMessageToAll(WHITE, " ");
SendClientMessageToAll(WHITE, " ");
SendClientMessageToAll(WHITE, " ");
SendClientMessageToAll(WHITE, " ");
SendClientMessageToAll(WHITE, " ");
SendClientMessageToAll(WHITE, " ");
print(" ");
print(" ");
print(" ");
print(" ");
print(" ");
print(" ");
print(" ");
print(" ");
print(" ");
print(" ");
print(" ");
print(" ");
print(" ");
print(" ");
GameTextForAll("Chat Cleared by an Admin", 3000, 5);
}
else return SendClientMessage(playerid, GREY, AdminOnly);
return 1;
}
For clear chat. zcmd is better
Re: /cleanchat cmd (rep +) -
Geeboi_Mehdi - 30.08.2012
Error
pawn Код:
C:\Users\Daoud\Desktop\Trucking Life\pawno\include\PPC_PlayerCommands.inc(5104) : error 017: undefined symbol "Player"
C:\Users\Daoud\Desktop\Trucking Life\pawno\include\PPC_PlayerCommands.inc(5104) : warning 215: expression has no effect
C:\Users\Daoud\Desktop\Trucking Life\pawno\include\PPC_PlayerCommands.inc(5104) : error 001: expected token: ";", but found "]"
C:\Users\Daoud\Desktop\Trucking Life\pawno\include\PPC_PlayerCommands.inc(5104) : error 029: invalid expression, assumed zero
C:\Users\Daoud\Desktop\Trucking Life\pawno\include\PPC_PlayerCommands.inc(5104) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
Re: /cleanchat cmd (rep +) -
DeathTone - 30.08.2012
replace Player[playerid][AdminLevel] with APlayerData[playerid][PlayerLevel]
Re: /cleanchat cmd (rep +) -
Geeboi_Mehdi - 30.08.2012
pawn Код:
C:\Users\Daoud\Desktop\Trucking Life\pawno\include\PPC_PlayerCommands.inc(5106) : error 017: undefined symbol "WHITE"
C:\Users\Daoud\Desktop\Trucking Life\pawno\include\PPC_PlayerCommands.inc(5107) : error 017: undefined symbol "WHITE"
C:\Users\Daoud\Desktop\Trucking Life\pawno\include\PPC_PlayerCommands.inc(5108) : error 017: undefined symbol "WHITE"
C:\Users\Daoud\Desktop\Trucking Life\pawno\include\PPC_PlayerCommands.inc(5109) : error 017: undefined symbol "WHITE"
C:\Users\Daoud\Desktop\Trucking Life\pawno\include\PPC_PlayerCommands.inc(5110) : error 017: undefined symbol "WHITE"
C:\Users\Daoud\Desktop\Trucking Life\pawno\include\PPC_PlayerCommands.inc(5111) : error 017: undefined symbol "WHITE"
C:\Users\Daoud\Desktop\Trucking Life\pawno\include\PPC_PlayerCommands.inc(5112) : error 017: undefined symbol "WHITE"
C:\Users\Daoud\Desktop\Trucking Life\pawno\include\PPC_PlayerCommands.inc(5113) : error 017: undefined symbol "WHITE"
C:\Users\Daoud\Desktop\Trucking Life\pawno\include\PPC_PlayerCommands.inc(5114) : error 017: undefined symbol "WHITE"
C:\Users\Daoud\Desktop\Trucking Life\pawno\include\PPC_PlayerCommands.inc(5115) : error 017: undefined symbol "WHITE"
C:\Users\Daoud\Desktop\Trucking Life\pawno\include\PPC_PlayerCommands.inc(5132) : error 017: undefined symbol "GREY"
C:\Users\Daoud\Desktop\Trucking Life\gamemodes\PPC_Trucking.pwn(86) : warning 217: loose indentation
C:\Users\Daoud\Desktop\Trucking Life\gamemodes\PPC_Trucking.pwn(598) : warning 217: loose indentation
C:\Users\Daoud\Desktop\Trucking Life\gamemodes\PPC_Trucking.pwn(909) : warning 217: loose indentation
C:\Users\Daoud\Desktop\Trucking Life\gamemodes\PPC_Trucking.pwn(1794) : warning 217: loose indentation
C:\Users\Daoud\Desktop\Trucking Life\gamemodes\PPC_Trucking.pwn(1890) : warning 225: unreachable code
C:\Users\Daoud\Desktop\Trucking Life\gamemodes\PPC_Trucking.pwn(1890) : warning 217: loose indentation
C:\Users\Daoud\Desktop\Trucking Life\gamemodes\PPC_Trucking.pwn(1893) : warning 217: loose indentation
C:\Users\Daoud\Desktop\Trucking Life\gamemodes\PPC_Trucking.pwn(2489) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
11 Errors.
Re: /cleanchat cmd (rep +) -
ThePrograme - 30.08.2012
here an easyer one :
pawn Код:
COMMAND:clearchat(playerid,params[])
{
if( PlayerInfo[ playerid ][ pAdmin ] >= 1 ) return SendClientMessage( playerid, COLOR_RED, "ERROR: You must be level 1 to use this command!" );
{
for( new i = 0; i <= 100; i ++ ) SendClientMessageToAll( -1, "" );
} return 1;
}
Re: /cleanchat cmd (rep +) -
Cypress - 30.08.2012
Replace
pawn Код:
SendClientMessageToAll(WHITE, " ");
with
pawn Код:
SendClientMessageToAll(-1, " ");
EDIT: too late
Re: /cleanchat cmd (rep +) -
XStormiest - 30.08.2012
pawn Код:
CMD:clearchat(playerid,params[])
{
if(PlayerInfo[playerid][Admin] < 1) return SendClientMessage(playerid,COLOR_RED,"You must be admin to use this!");
else
{
for(new i = 0; i < 11; i++)
SendClientMessageToAll(green," ");
}
return 1;
}
and this in top of script
Re: /cleanchat cmd (rep +) -
Cena44 - 30.08.2012
what admin system are you using? or one that you made yourself?