15.02.2009, 16:49
Well you should indent better, it makes reading errors easier. But you should also look into dcmd and sscanf. They are faster and a lot easier.
Or even less. Although, I hate when people code like this.
pawn Код:
dcmd_setskin(playerid,params[])
{
new player, skin;
if(sscanf(params,"dd",player,skin))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setskin [playerid] [skinid]");
return 1;
}
if(!IsPlayerConnected(player))
{
SendClientMessage(playerid, COLOR_WHITE, "Invalid Player ID.");
return 1;
}
if(IsInvalidSkin(skin))
{
SendClientMessage(playerid, COLOR_GREY, "* Invalid Skin ID");
return 1;
}
SetPlayerSkin(player, skin);
SendClientMessage(player, COLOR_WHITE, "An Admin has changed your skin.");
return 1;
}
pawn Код:
dcmd_setskin(playerid,params[])
{
new player, skin;
if(sscanf(params,"dd",player,skin)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setskin [playerid] [skinid]");
if(!IsPlayerConnected(player)) return SendClientMessage(playerid, COLOR_WHITE, "Invalid Player ID.");
if(IsInvalidSkin(skin)) return SendClientMessage(playerid, COLOR_GREY, "* Invalid Skin ID");
SetPlayerSkin(player, skin);
SendClientMessage(player, COLOR_WHITE, "An Admin has changed your skin.");
return 1;
}