[HELP] Change Skin Command
#1

Hey,

Okay so first i have this
pawn Код:
CMD:cskin(playerid,params[])
{
    new id;
    if(sscanf(params,"d",id)) return SendClientMessage(playerid,0xFF0000FF,"[USAGE]: /cskin [skin id]");
    {
        SetPlayerSkin(playerid,skinid);
        SendClientMessage(id,-1,"rule");
    }
    return 1;
}
but ofc i get an error about the "skinid" how would i define this ? what i would like is for any player to be able to change there skin also need help with a changecolor command, please comment below
Reply
#2

Change color?

See this anyway

Код:
//---------------------------------[SETSKIN]------------------------------------------------
	if(strcmp(cmd, "/setskin", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /setskin [playerid/PartOfName] [skin id]");
				return 1;
			}
			new para1;
			new level;
			para1 = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			level = strval(tmp);
			if(level > 299 || level < 1) { SendClientMessage(playerid, COLOR_GREY, "Wrong skin ID!"); return 1; }
			if (PlayerInfo[playerid][pAdmin] >= 3)
			{
			    if(IsPlayerConnected(para1))
			    {
			        if(para1 != INVALID_PLAYER_ID)
			        {
						GetPlayerName(para1, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						PlayerInfo[para1][pChar] = level;
						PlayerInfo[para1][pModel] = level;
						format(string, sizeof(string), "Your skin has been changed by Admin %s", sendername);
						SendClientMessage(para1, COLOR_WHITE, string);
						format(string, sizeof(string), "You have given %s skin to %d.", giveplayer,level);
						SendClientMessage(playerid, COLOR_WHITE, string);
					    SetPlayerSkin(para1, PlayerInfo[para1][pChar]);
					}
				}//not connected
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "   you are not authorized to use that command!");
			}
		}
		return 1;
	}
Reply
#3

pawn Код:
CMD:cskin(playerid,params[])
{
    new id;
    if( sscanf( params, "d", id) ) return SendClientMessage(playerid, 0xFF0000FF, "[USAGE]: /cskin [skin id]");
    SetPlayerSkin(playerid, id);
    SendClientMessage(id,-1,"rule");
    return 1;
}
Reply
#4

PHP код:
CMD:cskin(playerid,params[])
{
    new 
id,skinid;
    if(
sscanf(params,"d",id)) return SendClientMessage(playerid,0xFF0000FF,"[USAGE]: /cskin [skin id]");
    {
        
SetPlayerSkin(playerid,skinid);
        
SendClientMessage(id,-1,"rule");
    }
    return 
1;

Try that.
Reply
#5

thanks guys and btw sorry the SendClientMessage that was part from another one i copied XD
Reply
#6

pawn Код:
CMD:cskin(playerid,params[])
{
    new id;
    if( sscanf( params, "d", id) ) return SendClientMessage(playerid, 0xFF0000FF, "[USAGE]: /cskin [skin id]");
    SetPlayerSkin(playerid, id);
    SendClientMessageToAll(0xFFFFFFF,"[SERVER]: %s Has Just Changed His Skin Using /cskin!");
    return 1;
}
crashes server how to change?
Reply
#7

solved xD
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)