2 problems click here please.
#1

Hey guys

here is the code of a cmd.

Код:
CMD:setvipsil(playerid, params[])
{
	if (IsPlayerAdmin(playerid))
	{
		new
		  targetid, 
		  Year,
		  Month,
		  Day;
        getdate(Year, Month, Day);
		if (!sscanf(params, "u",playerid))
		{
		  if (targetid != INVALID_PLAYER_ID)
		  {
		    new
		      message[160];
		    ViPSilver[targetid] = 1;
		    format(message, sizeof(message), "{11DF1E}Admin %s made %s ViP Silver On %02d/%02d/%d {F33C32}.. Congratulations ..!", playerid, targetid, Day, Month, Year);
		    SendClientMessageToAll(0xAA3333AA, message);
		  }
		  else SendClientMessage(playerid, 0xFF0000FF, "That player is not connected.");
		}
		else SendClientMessage(playerid, 0xFFFFFFFF, "{2E14DC}Usage: /SetVipSilv (PlayerID).");
	}
	else SendClientMessage(playerid, 0xFF0000FF, "Only admins can use this command!");
	return 1;
}
and when i type /setvipsil
and set my self vip.

it sends

[04:19:09] {11DF1E}Admin made ViP Silver On 01/07/2011 {F33C32}.. Congratulations ..!

please help me thanks.
Reply
#2

what's wrong man?
Reply
#3

Listen when i type /setvipsil 0

It makes me VIP

[04:19:09] {11DF1E}Admin made ViP Silver On 01/07/2011 {F33C32}.. Congratulations ..!

Look in after Admin there is no name , and after made there is no name

please look the code up and tell me what's wrong in my mind i dont think anything is wrong.

thanks
Reply
#4

try this, you put in sscanf, playerid, not targetid

pawn Код:
CMD:setvipsil(playerid, params[])
{
    new targetid, Year, Month, Day;
    if (IsPlayerAdmin(playerid))
    {
        getdate(Year, Month, Day);
        if (sscanf(params, "u",targetid)) SendClientMessage(playerid, 0xFFFFFFFF, "{2E14DC}Usage: /SetVipSilv (PlayerID).");
          else if (targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000FF, "That player is not connected.");
          else
            new message[160];
            ViPSilver[targetid] = 1;
            format(message, sizeof(message), "{11DF1E}Admin %s made %s ViP Silver On %02d/%02d/%d {F33C32}.. Congratulations ..!", playerid, targetid, Day, Month, Year);
            SendClientMessageToAll(0xAA3333AA, message);
    }
    else SendClientMessage(playerid, 0xFF0000FF, "Only admins can use this command!");
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)