SA-MP Forums Archive
Warning : 202 - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Warning : 202 (/showthread.php?tid=606442)



Warning : 202 - Eymeric69 - 04.05.2016

Hi everybody there is my problem

Code :
Код:
COMMAND:serviceadmin(playerid, params[])
{
	// Send the command to all admins so they can see it
	SendAdminText(playerid, "/serviceadmin", params);

	// Exit the command if the player hasn't logged in using his password
	if (APlayerData[playerid][LoggedIn] == false) return 0;
	// Exit the command if the player has an admin-level lower than 1
	if (APlayerData[playerid][PlayerLevel] < 1) return 0;
    new AdminName[24];
	GetPlayerName(playerid, AdminName, sizeof(AdminName));
	SetPlayerSkin(playerid, 217);
	// message admin
 	SendClientMessage(playerid,0xFFFFFFFF, "Vous etes passez en admin en service !");
	SendClientMessageToAll(0xFFFFFFFF, "L'administrateur %s c'est mis en service", AdminName);
	return 1;
}
Warning :
Код:
C:\****\****\****\Serveur SAMP\gamemodes\****.pwn(17919) : warning 202: number of arguments does not match definition
Can you help me ?


Re: Warning : 202 - Konstantinos - 04.05.2016

https://sampwiki.blast.hk/wiki/Format

You need to format a string and then use it in SendClientMessageToAll.


Re: Warning : 202 - Nin9r - 04.05.2016

Change it " SendClientMessageToAll(0xFFFFFFFF, "L'administrateur %s c'est mis en service", AdminName); " with :

new string[128];
format(string, sizeof(string),"L'administrateur %s c'est mis en service", AdminName);
SendClientMessageToAll(0xFFFFFF, string);


Re: Warning : 202 - Eymeric69 - 04.05.2016

Ok it's fixed :

Код:
COMMAND:serviceadmin(playerid, params[])
{
	// Send the command to all admins so they can see it
	SendAdminText(playerid, "/serviceadmin", params);

	// Exit the command if the player hasn't logged in using his password
	if (APlayerData[playerid][LoggedIn] == false) return 0;
	// Exit the command if the player has an admin-level lower than 1
	if (APlayerData[playerid][PlayerLevel] < 1) return 0;
 	new AdminName[24];
	new string[128];
    GetPlayerName(playerid, AdminName, sizeof(AdminName));
	format(string, sizeof(string),"L'administrateur %s c'est mis en service !", AdminName);
	SendClientMessageToAll(0xFFFFFF, string);
	SetPlayerSkin(playerid, 217);
	// message admin
 	SendClientMessage(playerid,0xFFFFFFFF, "Vous etes passez en admin en service !");
	return 1;
}
Thank You All