13.12.2010, 18:06
pawn Код:
SetTimer("Message",inputtext,false); //inputtex - There i should put the time
pawn Код:
argument type mismatch (argument 2)
SetTimer("Message",inputtext,false); //inputtex - There i should put the time
argument type mismatch (argument 2)
stock IsNumeric(string[])
{
for (new i = 0, j = strlen(string); i < j; i++)
{
if (string[i] > '9' || string[i] < '0') return 0;
}
return 1;
}
If(IsNumeric(inputtext)) return continue; else break; // Never used continue or break, so if dont work, switch break for return false and continue for return true;
SetTimer("Message",inputtext ,false);
If(IsNumeric(inputtext)) return continue; else break;
what u mean? xD
Change: pawn Код:
pawn Код:
and is is possible to change the "1000" (1 sec) to 1 = 1 minute like: instead of typing "1000", you can just type 1 (1=minute) |
new adminPlayer[20];
forward BanHim(playerid);
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
if(IsPlayerAdmin(playerid))
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Admin Menu?", "Ban Player (Minutes)", "ok", "Cancel");
adminPlayer[playerid] = clickedplayerid;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)
{
switch(dialogid)
{
case 1:
{
switch(listitem)
{
case 0: ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Admin Menu", "Enter the time to the player get banned", "Ban", "Cancel");
}
}
case 2:
{
new playerwhogetbanned[MAX_PLAYER_NAME], string[44];
GetPlayerName(adminPlayer[playerid], playerwhogetbanned, sizeof(playerwhogetbanned));
format(string, sizeof(string), "Muhahah %s will be banned in %d mins",playerwhogetbanned, inputtext);
SendClientMessageToAll(0xFFFF00AA, string);
SetTimer("BanHim",inputtext ,false); //Inputtext = Minutes, not milliseconds
adminPlayer[playerid] = 0;
}
}
}
return 1;
}
public BanHim(playerid)
{
Ban(adminPlayer[playerid]);
}
case 2:
{
new playerwhogetbanned[MAX_PLAYER_NAME], string[44];
GetPlayerName(adminPlayer[playerid], playerwhogetbanned, sizeof(playerwhogetbanned));
format(string, sizeof(string), "Muhahah %s will be banned in %d mins",playerwhogetbanned, inputtext);
SendClientMessageToAll(0xFFFF00AA, string);
adminPlayer[playerid] = 0;
if(IsNumeric(inputtext))
{
SetTimer("BanHim",inputtext ,false); //Inputtext = Minutes, not milliseconds
}
}
Example.pwn(38) : error 035: argument type mismatch (argument 2)
SetTimer("BanHim",inputtext ,false); //At this line
SetTimer("lol",inputtext[0],false);