SA-MP Forums Archive
Little Question - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Little Question (/showthread.php?tid=157215)



Little Question - Erkan - 05.07.2010

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?


Re: Little Question - Carlton - 05.07.2010

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



Re: Little Question - Erkan - 05.07.2010

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;
}


Re: Little Question - Carlton - 05.07.2010

Try removing this:

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



Re: Little Question - Erkan - 05.07.2010

Still first letter


Re: Little Question - Erkan - 05.07.2010

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]);


Re: Little Question - Erkan - 06.07.2010

pushing+