strdel doesn't work... :\
#1

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
Reply
#2

what do you do with str after you have deleted the name from it?
Reply
#3

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...
Reply
#4

But this is only for str, do you save it to file too?
Reply
#5

So that means after strdel I have to save str back to the file?
Reply
#6

Quote:
Originally Posted by Justas [SiJ
]
So that means after strdel I have to save str back to the file?
Yes
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)