Help 15 pawn errors
#1

I trying to make server mtd but I can't solve this errors.


Code:
E:\Nova mapa (2)\gamemodes\Test.pwn(26) : error 009: invalid array size (negative, zero or out of bounds)
E:\Nova mapa (2)\gamemodes\Test.pwn(86) : error 017: undefined symbol "cmd"
E:\Nova mapa (2)\gamemodes\Test.pwn(90) : error 017: undefined symbol "pAdmin"
E:\Nova mapa (2)\gamemodes\Test.pwn(93) : error 017: undefined symbol "idx"
E:\Nova mapa (2)\gamemodes\Test.pwn(95) : error 017: undefined symbol "idx"
E:\Nova mapa (2)\gamemodes\Test.pwn(95) : warning 215: expression has no effect
E:\Nova mapa (2)\gamemodes\Test.pwn(97) : error 017: undefined symbol "idx"
E:\Nova mapa (2)\gamemodes\Test.pwn(99) : error 017: undefined symbol "idx"
E:\Nova mapa (2)\gamemodes\Test.pwn(101) : error 017: undefined symbol "idx"
E:\Nova mapa (2)\gamemodes\Test.pwn(102) : error 017: undefined symbol "idx"
E:\Nova mapa (2)\gamemodes\Test.pwn(102) : warning 215: expression has no effect
E:\Nova mapa (2)\gamemodes\Test.pwn(104) : error 017: undefined symbol "idx"
E:\Nova mapa (2)\gamemodes\Test.pwn(115) : error 017: undefined symbol "string"
E:\Nova mapa (2)\gamemodes\Test.pwn(115) : error 017: undefined symbol "string"
E:\Nova mapa (2)\gamemodes\Test.pwn(115) : error 029: invalid expression, assumed zero
E:\Nova mapa (2)\gamemodes\Test.pwn(115) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


15 Errors.


Code:
#include <a_samp>
#define COLOR_BLUE 0xFF0080FF
#define COLOR_GREY 0xFFC0C0C0
#define COLOR_GRAD2 0xFF800040

main()
{
	print("\n----------------------------------");
	print(" Test");
	print("----------------------------------\n");
}

new Motd[32];
new PlayerInfo[MAX_PLAYERS][pInfo];




public OnGameModeInit()
{
	// Don't use these lines if it's a filterscript
	SetGameModeText("Blank Gamemode");
	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	return 1;
}

public OnPlayerConnect(playerid)
{
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	return 1;
}

public OnPlayerSpawn(playerid)
{
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	return 1;
}

public OnVehicleSpawn(vehicleid)
{
	return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
	return 1;
}

public OnPlayerText(playerid, text[])
{
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{

	if(strcmp(cmd, "/setmotd", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(PlayerInfo[playerid][pAdmin] >= 5)
	        {
				new length = strlen(cmdtext);
				while ((idx < length) && (cmdtext[idx] <= ' '))
				{
					idx++;
				}
				new offset = idx;
				new result[32];
				while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
				{
					result[idx - offset] = cmdtext[idx];
					idx++;
				}
				result[idx - offset] = EOS;
				if(!strlen(result))
				{
					SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /setmotd [text]");
					return 1;
				}
				if(strlen(result) > 32)
                {
                    SendClientMessage(playerid, COLOR_GREY,"* Limit for MOTD is 32 Characters!");
                    return 1;
                }
				format(string, sizeof(string), "[ADMIN]: %s (%d) has set the MOTD to %s", sendername,playerid, (result));
				SendAdminMessage(COLOR_LIGHTRED,string);
				format(string, sizeof(string),"%s",(result));
				strmid(Motd,string,0,255,sizeof(string));
				format(string,sizeof(string),"%s.  Build %s",(result),Version);
				TextDrawSetString(Textdraw3,string);
				SaveMotd();
				new y, m, d;
				new h,mi,s;
				getdate(y,m,d);
				gettime(h,mi,s);
				format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /setmotd %s",d,m,y,h,mi,s,sendername, (result));
				AdminLog(string);
			}
		}
	    return 1;
	}


	return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
	return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
	return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
	return 1;
}

public OnRconCommand(cmd[])
{
	return 1;
}

public OnPlayerRequestSpawn(playerid)
{
	return 1;
}

public OnObjectMoved(objectid)
{
	return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
	return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
	return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
	return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
	return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
	return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
	return 1;
}

public OnPlayerExitedMenu(playerid)
{
	return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
	return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
	return 1;
}

public OnPlayerUpdate(playerid)
{
	return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
	return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
	return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
	return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
	return 1;
}

public showmotd(playerid)
{
	TextDrawShowForPlayer(playerid, Textdraw2);
    TextDrawShowForPlayer(playerid, Textdraw3);
    return 1;
}
I will be really happy if someone can solve this! Thanks.
Reply
#2

Are you kidding with us?
Reply
#3

new PlayerInfo[MAX_PLAYERS][pInfo]; without enum pinfo - you haven TRIED to make it you have TRIED to copy and paste it into your script.. -.-
Reply
#4

Well you obviously just copied + pasted the code you wanted..
If you learned to understand how the code works it would be so much easier to understand whats wrong, find the problem(s) and fix them yourself.
You copied it from a gm with a account system and much more..so i highly doubt your going to find it easy to fix your problem.
But try to do it yourself this time, in the end it will help you become a better scripter in a way.
It may take time but if you really want it done you will take that time to learn and do instead of having someone else waste their time for you.
Reply
#5

Srsly, He's Just Askin for help.


PHP Code:
public OnPlayerCommandText(playeridcmdtext[])
{
    new 
string[256];
           new 
cmd[256]; 
Under

PHP Code:
if(PlayerInfo[playerid][pAdmin] >= 5)
            { 
Put this

PHP Code:
new idx
PHP Code:
new PlayerInfo[MAX_PLAYERS][pInfo]; 
And Add a pInfo.

PHP Code:
enum pInfo
{
pAdmin,
}; 
Reply
#6

Looks like a copy from GF.
Reply
#7

Quote:
Originally Posted by BATAD
View Post
Srsly, He's Just Askin for help.


PHP Code:
public OnPlayerCommandText(playeridcmdtext[])
{
    new 
string[256];
           new 
cmd[256]; 
}
No point in using 256 for cmd, 128 is more than enough for it. string can be formatted to be exceeding 128, so 256 can go for it.
Reply
#8

jesus. Copy'n'Paste is not recommended. Try learn pawn yourself

and why new cmd 256 ? have you ever seen command long about 256 chars ?
Reply
#9

Quote:
Originally Posted by ylleron
View Post
jesus. Copy'n'Paste is not recommended. Try learn pawn yourself
Alright may everyone stop being Complete Retards ?, The Thread is asking for help, Not getting Spammed by people keep on saying, Copied and Learn how to use Pawn, He's still a beginner, He doesn't Know yet, I'd like to see how you idiots were like when you first found about pawno.exe
Reply
#10

Quote:
Originally Posted by BATAD
View Post
Alright may everyone stop being Complete Retards ?, The Thread is asking for help, Not getting Spammed by people keep on saying, Copied and Learn how to use Pawn, He's still a beginner, He doesn't Know yet, I'd like to see how you idiots were like when you first found about pawno.exe
the same as you.. ok stop spam
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)