Hmmm... Help.. please - 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)
+--- Thread: Hmmm... Help.. please (
/showthread.php?tid=318441)
Hmmm... Help.. please -
Buzzbomb - 15.02.2012
I made a Gang System.. And To make a gang you half to create so It shows them a dialog input box And they type the name Well the name is stored into the users ini file but Some reason It stores it as a string length in like Gang = 16 Here the code..
pawn Код:
this in the dialog response
GangName(playerid, strlen(inputtext));
this in its own public
public GangName(playerid, Gang)
{
new name[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), ARS_ACCOUNTS, name);
PlayerInfo[playerid][pGang] = Gang;
dini_IntSet(file, "Gang",PlayerInfo[playerid][pGang]);
return 1;
}
When gang is created i tried Test Of Testicles the outcome in the userfile Was Gang = 17
Re: Hmmm... Help.. please -
Buzzbomb - 15.02.2012
Man I need some scripting FRIENDS!!
Re: Hmmm... Help.. please -
iPLEOMAX - 15.02.2012
Show us your "
enum"
Re: Hmmm... Help.. please -
Roperr - 15.02.2012
dini_IntSet(file, "Gang",PlayerInfo[playerid][pGang]);
That's not correct. "dini_IntSet" is for setting values (integer). If you try to save a string it ends up as a random value.
Use "dini_Set", this saves the actual GangName string.
Re: Hmmm... Help.. please -
Universal - 15.02.2012
Why are you using strlen function? This returns the lenght of the string is that what you need?
pawn Код:
GangName(playerid, strlen(inputtext));
Re: Hmmm... Help.. please -
iPLEOMAX - 15.02.2012
If you are trying to save the string:
pawn Код:
//Change this part in your enum:
pGang to pGang[25]
//Under OnDialogResponse:
if(strlen(inputtext) > 24 || strlen(inputtext) < 5) return SendClientMessage(playerid, -1, "Use a name with 5 - 24 characters.");
GangName(playerid, inputtext);
public GangName(playerid, Gang[])
{
new name[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), ARS_ACCOUNTS, name);
format(PlayerInfo[playerid][pGang], 25, Gang);
dini_Set(file, "Gang", Gang);
return 1;
}
Not tested.