25.09.2011, 14:47
Hello
I have tried to make a /admin command but i get these errors
here is the part
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
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.
Код:
// 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;
}
When you have sent your message this dialog come up

When admin replies

Thanks

