21.06.2013, 16:03
I'm working on a better MDC for my RP script. The only area I'm getting stuck on is how to detect if the (inputtext) is online. (inputtext) = name typed.
I tried turning the (inputtext) into an integer using strval, but if the name isn't connected the integer just turns it into a player ID that is online.
So I'm working on doing somthing like this:
However, I get this error when I do that:
Anyone know how I can do this without errors, or know of a better way to check the name?
I tried turning the (inputtext) into an integer using strval, but if the name isn't connected the integer just turns it into a player ID that is online.
So I'm working on doing somthing like this:
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
new name[64];
if(GetPlayerName(i, name, sizeof(name)) == (inputtext))// Error Line
{
}
else
{
return ShowPlayerDialog(playerid, 9130,DIALOG_STYLE_INPUT,"Name Lookup","Error: No record of this name exists!\nType a valid name that you would like to lookup.","Search","Cancel");
}
}
}
Код:
error 033: array must be indexed (variable "inputtext")