05.07.2010, 23:14
Thanks, I tryed it it shows only the first letter
dcmd_haircut(playerid,params[])
{
new tmp[256], idx;
tmp = strtok(params,idx);
new otherplayer = strvalEx(tmp);
if(PlayerData[playerid][barber] < 1) return SendClientMessage(playerid, RED, "SERVER MESSAGE: You are not a Barber!");
if(!strlen(tmp)) { SendClientMessage(playerid, WHITE, "Correct Usage: /haircut [Playerid] [Style]"); return true; }
if(!IsPlayerConnected(otherplayer)) return SendClientMessage(playerid, RED, "SERVER MESSAGE: Incorrect ID");
if(otherplayer == playerid) return SendClientMessage(playerid, RED, "You can't make a Haircut yourself!");
tmp = strrest(params,idx);
new pname[MAX_PLAYER_NAME];
new pname2[MAX_PLAYER_NAME];
new string[256];
GetPlayerName(otherplayer, pname, sizeof(pname));
GetPlayerName(playerid, pname2, sizeof(pname2));
tmp = strrest(params, idx);
format(string, sizeof(string), "Barber %s has made you a %s Hairstyle", pname2,tmp);
SendClientMessage(otherplayer,RED, string);
strmid(PlayerData[playerid][barber], tmp, 0, strlen(tmp), 255);
return true;
}
dcmd_haircut(playerid,params[])
{
new tmp[256], idx;
tmp = strtok(params,idx);
new otherplayer = strvalEx(tmp);
if(PlayerData[playerid][barber] < 1) return SendClientMessage(playerid, RED, "SERVER MESSAGE: You are not a Barber!");
if(!strlen(tmp)) { SendClientMessage(playerid, WHITE, "Correct Usage: /haircut [Playerid] [Style]"); return true; }
if(!IsPlayerConnected(otherplayer)) return SendClientMessage(playerid, RED, "SERVER MESSAGE: Incorrect ID");
if(otherplayer == playerid) return SendClientMessage(playerid, RED, "You can't make a Haircut yourself!");
tmp = strrest(params,idx);
new pname[MAX_PLAYER_NAME];
new pname2[MAX_PLAYER_NAME];
new string[256];
GetPlayerName(otherplayer, pname, sizeof(pname));
GetPlayerName(playerid, pname2, sizeof(pname2));
tmp = strrest(params, idx);
format(string, sizeof(string), "Barber %s has made you a %s Hairstyle", pname2,tmp);
SendClientMessage(otherplayer,RED, string);
strmid(PlayerData[playerid][barber], tmp, 0, strlen(tmp), 255);
return true;
}