OnPlayerText(playerid, text[]) - 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: OnPlayerText(playerid, text[]) (
/showthread.php?tid=600001)
OnPlayerText(playerid, text[]) -
youmasterd7 - 02.02.2016
__________Espaсol__________
Resumen del pedido: - Juan dice: hola, їcomo te encuentras mi amigo?
*Dice mirando al sujeto*
Explicaciуn detallada del pedido: - Necesito hacer un sistema asн de parecido que digamos usted esta escribiendo normal y al momento de colocar un sнmbolo en este caso un " * " automбticamente extraer dos cadenas una que es antes del * y otra que sea despuйs del * pero eso ya con un cambio de color, digamos que serнa algo asн: Juan dice: hola, їcomo te encuentras mi amigo?
*Dice mirando al sujeto*
GM Base (opcional): - GM de 0
Notas (opcional): - NADA
__________English__________
Order summary: - John says: hello, how are you feeling my friend
* Says looking at the subject * ?
Detailed explanation of the order: - I need to make a system resembling that say you are writing normal and when placing a symbol in this case an "*" automatically extract two chains one that is before * and one that is after * but that's with a color change, say something like this: John says: hello, how are you feeling my friend
* Says looking at the subject * ?
GM Base (optional): - GM 0
Notes (optional): - NOTHING
Re: OnPlayerText(playerid, text[]) -
Jefff - 02.02.2016
pawn Код:
public OnPlayerText(playerid, text[])
{
new name[MAX_PLAYER_NAME + 1],string[145],i;
strcat(string,text);
while(string[i])
{
if(string[i] == '*' && string[i+1] != '*')
{
strdel(string,i,i+1);
strins(string,"{7B49AA}",i);
}
i++;
}
GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string),"%s says: %s {FFFFFF}?",name,string);
SendClientMessageToAll(-1,string);
return 0;
}