if(dialogid == DIALOG_ADUTY) { if(!response) return 1; if(response) { if(strfind(inputtext) == PI[playerid][pKod]) //Warning here { new string[128]; SetPlayerArmour(playerid, 100.0); g_SetPlayerHealth(playerid, 100.0); SetPlayerColor(playerid,AZUTA); format(string, sizeof(string), ""CRVENA"AG-AC | "BELA"Admin "HZELENA"%s "BELA"je na duznosti! (Admin Level %d)", GetName(playerid), PI[playerid][pAdmin]); AdminGameMaster(-1, string); AdminDuty[playerid] = 1; } else { SCM(playerid, -1, ""CRVENA"AG-AC | "BELA"Pogresili ste kod, kikovani ste!"); freeze[playerid] = SetTimerEx("KonektKick", 500, 0, "d", playerid); } } }
warning 202: number of arguments does not match definition
if(strfind("Are you in here?", "you", true) != -1) //returns 4, because the start of 'you' (y) is at index 4 in the string { SendClientMessageToAll(0xFFFFFFFF, "I found you!"); }
if(strfind(inputtext, PI[playerid][pKod], false) != -1)
if(strfind(inputtext, PI[playerid][pKod]) != -1)
If compiler shows you warnings (yes, not errors, warnings), don't ignore them because in most cases this usually means broken code.
https://sampwiki.blast.hk/wiki/Strfind pawn Код:
|
if(strfind(inputtext) == PI[playerid][pKod]) //Warning here
if(strfind(inputtext, PI[playerid][pKod]) != -1)
if(dialogid == DIALOG_ADUTY) { if(!response) return 1; if(response) { if(strcmp(inputtext, PI[playerid][pKod]) != -1) { new string[128]; SetPlayerArmour(playerid, 100.0); g_SetPlayerHealth(playerid, 100.0); SetPlayerColor(playerid,AZUTA); format(string, sizeof(string), ""CRVENA"AG-AC | "BELA"Admin "HZELENA"%s "BELA"je na duznosti! (Admin Level %d)", GetName(playerid), PI[playerid][pAdmin]); AdminGameMaster(-1, string); AdminDuty[playerid] = 1; } else { SCM(playerid, -1, ""CRVENA"AG-AC | "BELA"Pogresili ste kod, kikovani ste!"); freeze[playerid] = SetTimerEx("KonektKick", 500, 0, "d", playerid); } } }
printf("inputtext is %s", inputtext); printf("pKod is %s", PI[playerid][pKod]); if(strcmp(inputtext, PI[playerid][pKod]) != -1) {
if(strcmp(inputtext, PI[playerid][pKod]) == 0)
if(!strcmp(inputtext, PI[playerid][pKod]))
Strcmp is a little different, you have to check if the return IS 0. So
pawn Код:
pawn Код:
|