12.01.2011, 01:40
so im trying to make a simple skin changer,
but im getting this
i have only started coding in dcmd as of last night lol......
thanks.
PHP Code:
#pragma tabsize 0
#include <a_samp>
#include <core>
#include <float>
#include "../include/gl_common.inc"
#define FILTERSCRIPT
#if defined FILTERSCRIPT
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_WHITE 0xFFFFFFFF
forward SendPlayerFormattedText(playerid, const str[], define);
//------------------------------------------------------------------------------------------------------
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print("DCMD FilterScript");
print("--------------------------------------\n");
return 1;
}
//------------------------------------------------------------------------------------------------------
dcmd_skin(const playerid,const params[]) {
#pragma unused params
new tmp[128];
new skinid = tmp[128];
SetPlayerSkin(playerid, skinid);
return true;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(skin,4,cmdtext);
return 0;
}
//-------------------------------------------------------------------------------------------------------
public SendPlayerFormattedText(playerid, const str[], define)
{
new tmpbuf[256];
format(tmpbuf, sizeof(tmpbuf), str, define);
SendClientMessage(playerid, 0xFF004040, tmpbuf);
}
public OnFilterScriptExit()
{
print("dcmd FilterScript Unloaded");
return 0;
}
#endif
Code:
C:\Server\SA-MP_Server 3.0c\filterscripts\dcmd.pwn(37) : error 032: array index out of bounds (variable "tmp") Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error.
thanks.