01.11.2014, 05:59
(
Последний раз редактировалось Quickie; 01.11.2014 в 06:29.
)
hello
am i using the strins the right way it should be used?
i typed to my client
the result is
the id 0 should be replaced with my name (Quickie) but nothing happens and it looks like my code finished in strins
THE console print
and the code stopped at strdel
i hope you can help me with this problem
thank you in advance
am i using the strins the right way it should be used?
pawn Код:
public OnPlayerText(playerid, text[])
{
new findid=strfind(text,"id",true,0);
if(findid!=-1)
{
new msg[20],id,extra,pname[MAX_PLAYER_NAME];
strmid(msg,text,findid,findid+5);
if(sscanf(msg,"uu",extra,id))
{
return 1;
}
if(id==INVALID_PLAYER_ID)
{
return 1;
}
printf("findid %d",findid);
GetPlayerName(id,pname,sizeof(pname));
printf("sizeof %d",sizeof(pname));
printf("strlen %d",strlen(pname));
printf( "getname %s",pname);
strdel(text,findid,findid+5);
print("strdel");
strins(text,pname,findid,sizeof(pname));
print("strins");
printf("%s",text);
SendClientMessageToAll(-1,text);
return 0;
}
return 1;
}
Quote:
test hello hello 0 id 0 yes hello |
Quote:
test hello hello 0 yes hello |
THE console print
Код:
findid 19 sizeof 24 strlen 7 getname Quickie strdel
i hope you can help me with this problem
thank you in advance