if(strcmp(cmd,"/appearance",true) == 0) { if(IsPlayerConnected(playerid)) { GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[128]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /appearance [Description]"); return 1; } strmid(PlayerInfo[playerid][pApp], result, 0, strlen(result), 255); SendClientMessage(playerid,COLOR_GREY,"You have adjusted your appearance."); return 1;
command(appearance, playerid, params[])
{
new desc[128];
if(sscanf(params, "s[128]", desc)) return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /appearance [Description]");
strmid(PlayerInfo[playerid][pApp], desc, 0, strlen(desc), 255);
SendClientMessage(playerid,COLOR_GREY,"You have adjusted your appearance.");
return 1;
}
or
command(appearance, playerid, params[])
{
if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /appearance [Description]");
strmid(PlayerInfo[playerid][pApp], params, 0, strlen(params), 255);
SendClientMessage(playerid,COLOR_GREY,"You have adjusted your appearance.");
return 1;
}
Smaller.
pawn Код:
|
CMD:appearance( playerid, params[] )
{
if( !isnull( params ) )
{
strcat( PlayerInfo[playerid][pApp], params, sizeof( PlayerInfo[playerid][pApp] ) );
SendClientMessage(playerid,COLOR_GREY,"You have adjusted your appearance.");
}
else
{
SendClientMessage( playerid, COLOR_GRAD2, "USAGE: /appearance [Description]");
}
}
if(strcmp(cmd, "/describe", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You need to login first !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "HINT: /describe [playerid/PartOfName]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
format(string, sizeof(string), "%s's appearance:", giveplayer);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "%s", PlayerInfo[giveplayerid][pApp]);
SendClientMessage(playerid, COLOR_PURPLE, string);
return 1;
}
}
}
return 1;
}
command(describe, playerid, params[])
{
new name[MAX_PLAYER_NAME], id;
if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_GREY, " You need to login first !");
if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_WHITE, "HINT: /describe [playerid/PartOfName]");
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s's appearance:", name);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "%s", PlayerInfo[id][pApp]);
SendClientMessage(playerid, COLOR_PURPLE, string);
return 1;
}