/admin command help -
Trucker[UK] - 25.09.2011
Hello
I have tried to make a /admin command but i get these errors
Код:
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\SAMP\Samp\pawno\include\PPC_PlayerCommands.inc(97) : error 017: undefined symbol "admin"
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\SAMP\Samp\pawno\include\PPC_PlayerCommands.inc(103) : error 017: undefined symbol "YourName"
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\SAMP\Samp\pawno\include\PPC_PlayerCommands.inc(103) : error 029: invalid expression, assumed zero
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\SAMP\Samp\pawno\include\PPC_PlayerCommands.inc(103) : warning 215: expression has no effect
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\SAMP\Samp\pawno\include\PPC_PlayerCommands.inc(104) : error 017: undefined symbol "OtherPlayer"
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\SAMP\Samp\pawno\include\PPC_PlayerCommands.inc(104) : error 017: undefined symbol "OtherPlayerName"
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\SAMP\Samp\pawno\include\PPC_PlayerCommands.inc(104) : error 029: invalid expression, assumed zero
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\SAMP\Samp\pawno\include\PPC_PlayerCommands.inc(104) : fatal error 107: too many error messages on one line
7 Errors.
here is the part
Код:
// This commands allows the player to send a admin for help
COMMAND:admin(playerid, params[])
{
// Setup local variables
new Message[128], Msg1[128], Msg2[128];
// Send the command to all admins so they can see it
SendAdminText(playerid, "/admin", params);
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
if (sscanf(params, "us[128]", Message)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/admin <Message>\"");
else
{
// Check if that other player is online
if (IsPlayerConnected(admin))
{
// Check if the player isn't muted
if (APlayerData[playerid][Muted] == false)
{
// Get both names
GetPlayerName(playerid, sizeof(YourName));
GetPlayerName(OtherPlayer, OtherPlayerName, sizeof(OtherPlayerName));
// Construct the message that is sent to yourself
ShowPlayerDialog(playerid, DialogMessageSent, DIALOG_STYLE_MSGBOX, "Message Sent", Msg, "OK");
format(Msg1, 128, "{808080}Your message has been sento to admins. Thank you.{FFFFFF}");
// Construct the message that is sent to the other player
format(Msg2, 128, "{FF0000}Message from admin {FF0000}:", Message);
// Send the messages
SendClientMessage(playerid, 0xFFFFFFFF, Msg1);
SendClientMessage(OtherPlayer, 0xFFFFFFFF, Msg2);
}
else
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}You are still muted");
}
else
SendClientMessage(playerid, 0xFF0000FF, "Player is not online");
}
}
else
return 0;
// Let the server know that this was a valid command
return 1;
}
Please help me and i will rep u if it works
When you have sent your message this dialog come up
When admin replies
Thanks
Re: /admin command help -
aRoach - 25.09.2011
pawn Код:
// This commands allows the player to send a admin for help
CMD:admin( playerid, params[ ] )
{
// Setup local variables
new Message[128], Msg1[128], Msg2[128],
YourName[ MAX_PLAYER_NAME ], OtherPlayerName[ MAX_PLAYER_NAME ];
// Send the command to all admins so they can see it
SendAdminText(playerid, "/admin", params);
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
if (sscanf(params, "s[128]", Message)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/admin <Message>\"");
// Check if that other player is online
if (IsPlayerConnected(admin))
{
// Check if the player isn't muted
if (APlayerData[playerid][Muted] == false)
{
// Get both names
GetPlayerName(playerid, YourName, sizeof(YourName));
GetPlayerName(OtherPlayer, OtherPlayerName, sizeof(OtherPlayerName));
// Construct the message that is sent to yourself
ShowPlayerDialog(playerid, DialogMessageSent, DIALOG_STYLE_MSGBOX, "Message Sent", Msg, "OK");
format(Msg1, 128, "{808080}Your message has been sento to admins. Thank you.{FFFFFF}");
// Construct the message that is sent to the other player
format(Msg2, 128, "{FF0000}Message from admin {FF0000}: %s", Message);
// Send the messages
SendClientMessage(playerid, 0xFFFFFFFF, Msg1);
for( new i = 0; i < MAX_PLAYERS; i ++ )
{
if( APlayerData[ i ][ Level ] > 0 ) SendClientMessage( i, 0xFFFFFFFF, Msg2 );
}
}
else
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}You are still muted");
}
else
SendClientMessage(playerid, 0xFF0000FF, "Player is not online");
}
}
Re: /admin command help -
Trucker[UK] - 25.09.2011
now these 11 errors
Код:
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\SAMP\Samp\pawno\include\PPC_PlayerCommands.inc(97) : error 017: undefined symbol "admin"
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\SAMP\Samp\pawno\include\PPC_PlayerCommands.inc(104) : error 017: undefined symbol "OtherPlayer"
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\SAMP\Samp\pawno\include\PPC_PlayerCommands.inc(106) : error 017: undefined symbol "DialogMessageSent"
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\SAMP\Samp\pawno\include\PPC_PlayerCommands.inc(114) : error 017: undefined symbol "Level"
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\SAMP\Samp\pawno\include\PPC_PlayerCommands.inc(124) : error 010: invalid function or declaration
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\SAMP\Samp\pawno\include\PPC_PlayerCommands.inc(125) : error 010: invalid function or declaration
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\SAMP\Samp\pawno\include\PPC_PlayerCommands.inc(128) : error 010: invalid function or declaration
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\SAMP\Samp\pawno\include\PPC_PlayerCommands.inc(1053) : error 037: invalid string (possibly non-terminated string)
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\SAMP\Samp\pawno\include\PPC_PlayerCommands.inc(1053) : error 017: undefined symbol "your"
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\SAMP\Samp\pawno\include\PPC_PlayerCommands.inc(1053) : error 017: undefined symbol "own"
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\SAMP\Samp\pawno\include\PPC_PlayerCommands.inc(1053) : fatal error 107: too many error messages on one line
11 Errors.
Re: /admin command help -
aRoach - 25.09.2011
Man, you don't have these Variables / enums / news.
ex.
pawn Код:
new admin;
enum DUDE_DUDE
{
Level,
Time,
VIP
// And others
}
Re: /admin command help -
Trucker[UK] - 25.09.2011
so were would i add these in the playercommand.inc file
Re: /admin command help -
aRoach - 25.09.2011
Give me this include dude....
Re: /admin command help -
Trucker[UK] - 25.09.2011
ok will pm u link