Any ideas about putting string end here? Can't compile
#1

TEXT is formatted inputtext

if (TEXT [_+1] == '\0') return SendClientMessage (playerid, -1, "Underscore is in end of the string!");
if (TEXT [_-1] == '\0') return SendClientMessage (playerid, -1, "Underscore is in begin of the string!");

Invalid expression assumed zero
Reply
#2

As far as my experience goes (not that long lol), you can't use strings in if-statements. Also not sure what you're trying to do there lol. :P
Reply
#3

Well its dialog where is inputtext character name that means if he put undesrcore to first start of string or to end of string he will got returned im tryiing to do it but idk how

Becouse name is firstname_lastname
Reply
#4

Simply use sscanf. It's not solely for commands;
pawn Код:
if(sscanf(text, "{p<_>s[20]s[20]}"))
{
    // Invalid
}
Reply
#5

Gonna to try it, but quite don't understand that code.. I was using time ago sscanf but just for parameters in commands.. Anyway thx..

//EDIT WONDERFUL thanx lol it works
Reply
#6

hmm it works.. but how can I make, so it will check underscore not only begin and end of the string? Except one type which is Name_Lastname
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)