.pwn(13227) : error 035: argument type mismatch (argument 2) .pwn(13236) : warning 213: tag mismatch .pwn(13237) : warning 213: tag mismatch
if(dialogid == 1059) { if(!response) // If they clicked 'Cancel' or pressed esc { SendClientMessage(playerid,0xFF0000,"* Good Luck"); } else // Pressed ENTER or clicked 'Login' button { if(strcmp(inputtext, 0, true) // line 13227 { new vardas[MAX_PLAYER_NAME], Pdb_ZP_name[41]; strmid(vardas,inputtext,0,MAX_PLAYER_NAME); new id = GetPlayeridMid(vardas); if (id == INVALID_PLAYER_ID){ SendClientMessage(playerid, RED, "* No player found"); return 1;} GetPlayerName(playerid, vardas, MAX_PLAYER_NAME); format(Pdb_ZP_name, sizeof(Pdb_ZP_name), "%s", vardas); TextDrawSetString(Pdb_ZP[playerid][6], Pdb_ZP_name); // line 13236 TextDrawShowForPlayer(playerid, Pdb_ZP[playerid][6]); // line 13237 for(new k; k < 15; k++) PlayerTextDrawShow(playerid,Pdb_ZP[playerid][k]); IsPdbOpen[playerid] = 1; return 1; } else { SendClientMessage(playerid,0xFF0000,"*No player found"); // Re-show the login dialog ShowPlayerDialog(playerid,1059, DIALOG_STYLE_INPUT, "Test", "Search player by name:", "Search", "close"); } } return 1; }
if(dialogid == 1059)
{
if(!response) // If they clicked 'Cancel' or pressed esc
{
SendClientMessage(playerid,0xFF0000,"* Good Luck");
}
else // Pressed ENTER or clicked 'Login' button
{
if(strcmp(inputtext, "0", true)) // line 13227
{
new vardas[MAX_PLAYER_NAME], Pdb_ZP_name[41];
strmid(vardas,inputtext,0,MAX_PLAYER_NAME);
new id = GetPlayeridMid(vardas);
if (id == INVALID_PLAYER_ID){ SendClientMessage(playerid, RED, "* No player found"); return 1;}
GetPlayerName(playerid, vardas, MAX_PLAYER_NAME);
format(Pdb_ZP_name, sizeof(Pdb_ZP_name), "%s", vardas);
TextDrawSetString(Text:Pdb_ZP[playerid][6], Pdb_ZP_name); // line 13236
TextDrawShowForPlayer(playerid, Text:Pdb_ZP[playerid][6]); // line 13237
for(new k; k < 15; k++)
PlayerTextDrawShow(playerid,Pdb_ZP[playerid][k]);
IsPdbOpen[playerid] = 1;
return 1;
}
else
{
SendClientMessage(playerid,0xFF0000,"*No player found");
// Re-show the login dialog
ShowPlayerDialog(playerid,1059, DIALOG_STYLE_INPUT, "Test", "Search player by name:", "Search", "close");
}
}
return 1;
}
if(strcmp(inputtext, 0, true)
Thank you! So far, i understand, what's the Problem, but have no idea, what second should i compare with. I want, to compare inputtext, with the Online player name, and if found, open the Textdraw.
|
if(strcmp(inputtext, 0, true) // line 13227
new id = GetPlayerIdFromName(inputtext);
if(id != INVALID_PLAYER_ID)
new vardas[MAX_PLAYER_NAME], Pdb_ZP_name[41];
strmid(vardas,inputtext,0,MAX_PLAYER_NAME);
new id = GetPlayeridMid(vardas);
new Pdb_ZP_name[41];
new Pdb_ZP_name[41]; format(Pdb_ZP_name, sizeof(Pdb_ZP_name), "%s", id); // maybe id, but seems not working. PlayerTextDrawSetString(playerid, Pdb_ZP[playerid][7], Pdb_ZP_name); PlayerTextDrawShow(playerid,Pdb_ZP[playerid][7]); |
Thanks, seems working!
Do you maybe know, how can i get a Player name to the Textdraw now? Anyway, thanks for help, letting me understand, how all this works. |
stock GetPlayerIdFromName(playername[]) { for(new i = 0; i <= MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { new playername2[MAX_PLAYER_NAME]; GetPlayerName(i, playername2, sizeof(playername2)); if(strcmp(playername2, playername, true, strlen(playername)) == 0) { format(playername, sizeof playername2, playername2); return i; } } } return INVALID_PLAYER_ID; }
format(Pdb_ZP_name, sizeof(Pdb_ZP_name), "%s", id); // maybe id, but seems not working.
format(Pdb_ZP_name, sizeof(Pdb_ZP_name), "%s", inputtext); // maybe id, but seems not working.