Warning : 202
#1

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 ?
Reply
#2

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

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

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);
Reply
#4

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)