09.05.2011, 16:55
Код:
if(IsValidText("Hi there")) return SendClientMessage(playerid, 0xFF0000FF, "Valid Text"); // Correct if(IsValidText(":> Hello There")) return SendClientMessage(playerid, 0xFF0000FF, "Invailid Text"); // Correct if(IsValidText("Hello :> There")) return SendClientMessage(playerid, 0xFF0000FF, "Vailid Text"); // Wrong
pawn Код:
stock IsValidText(text[])
{
for(new i = 0; i < sizeof(text[]); i++)
{
if(text[i] == 'a' || text[i] == 'b' || text[i] == 'c' || text[i] == 'd'
|| text[i] == 'e' || text[i] == 'f' || text[i] == 'g' || text[i] == 'h'
|| text[i] == 'i' || text[i] == 'j' || text[i] == 'k' || text[i] == 'l'
|| text[i] == 'm' || text[i] == 'n' || text[i] == 'o' || text[i] == 'p'
|| text[i] == 'q' || text[i] == 'r' || text[i] == 's' || text[i] == 't'
|| text[i] == 'u' || text[i] == 'v' || text[i] == 'w' || text[i] == 'x'
|| text[i] == 'y' || text[i] == 'z')
return 1;
}
return 0;
}