Using the same variable twice in a string
#1

I'm trying to make an admin chat for a test gamemode I'm making, I just started learning how to code pawno about 10 hours ago and I've had help from a few advanced friends. I'm trying to store the player's name and what they typed both as the variable of %s, using it twice. The player's name is correctly displayed but their message is show as y. Included below is the code.

Код:
CMD:achat(playerid,params[])
{
	
	new admins[MAX_PLAYERS];
	#define admin 0
	new name[MAX_PLAYER_NAME+1], string[70];
	new text[128];
	if(IsPlayerAdmin(playerid))
	{
	    if(sscanf(params, "uu", text)) return SendClientMessage(playerid,COL_WHITE,"[USAGE]: /achat [message]");
	    admins[playerid] = admin;
	    GetPlayerName(playerid,name,sizeof(name));
	    format(string, sizeof(string), "(( %s: %s ))", name, text);
	    SendClientMessage(admin,COL_YELLOW,string);
	}
	else
	{
	    if(sscanf(params, "uu", text)) return SendClientMessage(playerid,COL_WHITE,"[ERROR]: You do not have access to this command!");
	}
	
	return 1;
}
Reply


Messages In This Thread
Using the same variable twice in a string - by FireShooter10 - 16.08.2013, 20:56
Re: Using the same variable twice in a string - by Edix - 16.08.2013, 21:45
Re: Using the same variable twice in a string - by gtakillerIV - 16.08.2013, 21:49
Re: Using the same variable twice in a string - by Edix - 16.08.2013, 21:53
Re: Using the same variable twice in a string - by andruz99 - 17.08.2013, 09:01
Respuesta: Using the same variable twice in a string - by Strier - 17.08.2013, 09:13

Forum Jump:


Users browsing this thread: 1 Guest(s)