25.04.2010, 10:34
Hello,
I use one dialog to change skins and i get two errors:
I use input text like this:
Lines of errors is here:
This is about IsInvalidSkin
Can any one help me to remove that problem....
I use one dialog to change skins and i get two errors:
Код:
C:\Users\User\Desktop\Drift\Drift\gamemodes\Drift.pwn(2634) : error 035: argument type mismatch (argument 1) C:\Users\User\Desktop\Drift\Drift\gamemodes\Drift.pwn(2636) : error 035: argument type mismatch (argument 2) Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors.
pawn Код:
ShowPlayerDialog(playerid,3,DIALOG_STYLE_INPUT,"Change your skin","Enter your model/skin id below:","Change","Close");
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 3)
{
if(response)
{
if(!IsInvalidSkin(inputtext))// error 1 is here.
{
SetPlayerSkin(playerid, inputtext);// error 2 is here.
SendClientMessage(playerid,COLOR_GREEN,"You change your skin");
new skinmenu[] = "Check my skin\nChange skin\n";
ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"My Skin, Here you can change your skin.",skinmenu,"Use","Close");
return 1;
}
else
{
SendClientMessage(playerid,COLOR_RED,"This is invalid skin");
new skinmenu[] = "Check my skin\nChange skin\n";
ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"My Skin, Here you can change your skin.",skinmenu,"Use","Close");
return 1;
}
}
return 1;
}
pawn Код:
IsInvalidSkin(skinid)
{ // Created by Simon
// Checks whether the skinid parsed is crashable or not.
#define MAX_BAD_SKINS 14
new badSkins[MAX_BAD_SKINS] = {3, 4, 5, 6, 8, 42, 65, 74, 86, 119, 149, 208, 273, 289};
for (new i = 0; i < MAX_BAD_SKINS; i++)
{
if (skinid == badSkins[i]) return true;
}
return false;
}