Strdel not 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)
+--- Thread: Strdel not work! (
/showthread.php?tid=483969)
Strdel not work! -
xGame - 28.12.2013
Hi,
I do a script with strdel, the script delete the gang tag but don't work.
This is the script:
PHP код:
new nick[20];
format(nick,sizeof(nick),"%s",GetPlayerNameEx(playerid));
new lenght = strlen(GetPlayerNameEx(playerid));
new lenght1 = strlen(Gang[Info[playerid][aGang]]);
new lenght3 = lenght-lenght1;
strdel(nick, lenght3, lenght);
SetPlayerName(playerid,nick);
Thanks
Re: Strdel not work! - Emmet_ - 29.12.2013
pawn Код:
new
name[MAX_PLAYER_NAME],
pos;
format(name, MAX_PLAYER_NAME, GetPlayerNameEx(playerid));
if ((pos = strfind(name, Gang[Info[playerid][aGang]])) != -1)
{
strdel(name, pos, pos + strlen(Gang[Info[playerid][aGang]]));
}
SetPlayerName(playerid, name);
Re: Strdel not work! -
xGame - 29.12.2013
Thanks! It's work!
rep+