Bonjour à tous,
Voilà je débute donc en PWN, je souhaite créer une commande où les admins connectés pourront parler "Admin : message", pour cela j'ai pris comme modèle la commande /me du include, en y rajoutant la vérif si le joueur a le niveau de pouvoirs qu'il faut (lvl 3), en enlevant le paramètre "Name", puisque dans le message "Admin", on précisera pas le nom de l'admin.
Voilà mon code :
<br />{<br /><span style=)
// Setup local variables
new Msg[128], Message[128];
// Send the command to all admins so they can see it
SendAdminText(playerid, "/atext", params);
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Check if the player's admin-level is at least 3
if (APlayerData[playerid][PlayerLevel] >= 3)
{
if (sscanf(params, "s[128]", Message)) SendClientMessage(playerid, 0xFF0000AA, "Utilisation: \"/atext <Message>\"");
else
{
// Check if the player isn't muted
if (APlayerData[playerid][Muted] == false)
{
format(Msg, sizeof(Msg), "Admin : %s", Message);
SendClientMessageToAll(0xFF6347FF, Msg);
}
else
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Vous ne pouvez toujours pas écrire");
)
}
else
SendClientMessage(playerid, 0xFF0000FF, "Vous n'avez pas les droits requis");
)
else
return 0;
// Let the server know that this was a valid command
return 1;
}" alt="" class="bbc_img" />
Les erreurs :
D:\...\Serveur SAMP\PPC_Trucking6\pawno\include\PPC_PlayerCommands.inc(4993) : warning 217: loose indentation
D:\...\Serveur SAMP\PPC_Trucking6\pawno\include\PPC_PlayerCommands.inc(4993) : error 029: invalid expression, assumed zero
D:\...\Serveur SAMP\PPC_Trucking6\pawno\include\PPC_PlayerCommands.inc(4995) : warning 217: loose indentation
D:\...\Serveur SAMP\PPC_Trucking6\pawno\include\PPC_PlayerCommands.inc(4995) : error 029: invalid expression, assumed zero
D:\...\Serveur SAMP\PPC_Trucking6\pawno\include\PPC_PlayerCommands.inc(4996) : warning 217: loose indentation
D:\...\Serveur SAMP\PPC_Trucking6\pawno\include\PPC_PlayerCommands.inc(4997) : warning 217: loose indentation
D:\...\Serveur SAMP\PPC_Trucking6\pawno\include\PPC_PlayerCommands.inc(4997) : error 029: invalid expression, assumed zero
D:\...\Serveur SAMP\PPC_Trucking6\pawno\include\PPC_PlayerCommands.inc(4997 -- 4998) : warning 215: expression has no effect
D:\...\Serveur SAMP\PPC_Trucking6\pawno\include\PPC_PlayerCommands.inc(4998) : error 001: expected token: ";", but found "else"
D:\...\Serveur SAMP\PPC_Trucking6\pawno\include\PPC_PlayerCommands.inc(4998) : error 029: invalid expression, assumed zero
D:\...\Serveur SAMP\PPC_Trucking6\pawno\include\PPC_PlayerCommands.inc(4998) : fatal error 107: too many error messages on one line
(
... : chemin tronqué pour plus de clarté)
Merci par avance!