Hey all, need some maths help - 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: Hey all, need some maths help (
/showthread.php?tid=294397)
Hey all, need some maths help -
StuffBoy - 01.11.2011
I made this script it removes the ATTRACTORS string and the underscore "_" so i can have the anim name from a extern file, and it works the output is "STEPSIT_IN".
pawn Код:
for(new i; i < 32; i++) // form the anim name
{
new formatname[64];
format(formatname, sizeof(formatname),"ATTRACTORS_STEPSIT_IN");
if( formatname[i] == '_')
{
new animname[32];
formatname[i] = ' ';
format(animname, sizeof(animname),"%s", formatname[i]);
printf("formatname = %s", formatname);
printf("anim name %s",animname);
break;
}
}
Now i need to make This one Give me only the ATTRACTORS word into libname variable here goes the code too
pawn Код:
for(new i; i < 32; i++)
{
new formatname[64];
format(formatname, sizeof(formatname),"ATTRACTORS_STEPSIT_IN");
if(formatname[i] == '_')
{
// new libname[32];
break;
}
}
Re: Hey all, need some maths help -
Vince - 01.11.2011
pawn Код:
new formatname[64] = "ATTRACTORS_STEPSIT_IN";
strmid(libname, formatname, 0, strfind(formatname, "_"));
Re: Hey all, need some maths help -
StuffBoy - 01.11.2011
Thanks but i figured out that what i want will not work that way