Little Question
#1

Hello people,

I would ask something, I am trying to make a Barber/Tattoo Job I succeed, but I need help on the stats thing like the Barber comes to that player he makes /haircut (playerid) (style), he types in style just Affro in and it should save that on the Status Script, I want to make a Code that saves it I tryed it but I failed.

PlayerData[playerid][barber] == ("%s",tmp);

something like that, anyone can help?
Reply
#2

pawn Код:
strmid(PlayerData[playerid][barber], tmp, 0, strlen(tmp), 255);
Reply
#3

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;
}
Reply
#4

Try removing this:

pawn Код:
tmp = strrest(params,idx);
Reply
#5

Still first letter
Reply
#6

It could come from the Stats script too check this

format(string, sizeof(string), "IC: Respect: %d | Fear: %d | Driving License: %d | Gun License: %d | Wanted Level: %d | HairStyle: %s", respect, fear, driving, gun, wanted,bbarber);
SendClientMessageToAll(GREY, string);


and it saves like this
dUserSetINT(PlayerName(playerid)).("aBarber", PlayerData[playerid][abarber]);
Reply
#7

pushing+
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)