strdel doesn't work... :\ - 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: strdel doesn't work... :\ (
/showthread.php?tid=90355)
strdel doesn't work... :\ -
SiJ - 07.08.2009
Hey,
My code:
pawn Код:
stock KickFromGang(PlayerID,GangName[])
{
if(!dini_Exists(GangName)) return -1;
new str[512],name[24];
GetPlayerName(PlayerID,name,24);
str = dini_Get(GangName,"Members");
new position = strfind(str,name,true);
if(position != 1)
{
strdel(str, position, position + strlen(name) + 1);
return 1;
}
return 0;
}
And this doesn't deletes
name from
str..
It doesn't shows any errors or anything.. :S
Re: strdel doesn't work... :\ -
MadeMan - 07.08.2009
what do you do with str after you have deleted the name from it?
Re: strdel doesn't work... :\ -
SiJ - 07.08.2009
Quote:
Originally Posted by MadeMan
what do you do with str after you have deleted the name from it?
|
str is line "
Members" from file
GangName, so it just deletes
name and leave other Names in their place...
Re: strdel doesn't work... :\ -
MadeMan - 07.08.2009
But this is only for str, do you save it to file too?
Re: strdel doesn't work... :\ -
SiJ - 07.08.2009
So that means after strdel I have to save
str back to the file?
Re: strdel doesn't work... :\ -
MadeMan - 07.08.2009
Quote:
Originally Posted by Justas [SiJ
]
So that means after strdel I have to save str back to the file? 
|
Yes