array is too small [Problem] - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: array is too small [Problem] (
/showthread.php?tid=516852)
array is too small [Problem] -
Team_PRO - 02.06.2014
PHP код:
C:\Users\Matt\Desktop\SAMP\UMRP\gamemodes\UMRP.pwn(7161) : error 047: array sizes do not match, or destination array is too small
C:\Users\Matt\Desktop\SAMP\UMRP\gamemodes\UMRP.pwn(7163) : error 047: array sizes do not match, or destination array is too small
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
2 Errors.
PHP код:
public OnPlayerDisconnect(playerid, reason)
{
// IRC
new leaveMsg[128], name[MAX_PLAYER_NAME], reasonMsg[8];
switch(reason)
{
case 0: reasonMsg = "Timeout/Crashed";
case 1: reasonMsg = "Leaving";
case 2: reasonMsg = "Kicked/Banned";
}
Re: array is too small [Problem] -
Adityz - 02.06.2014
PHP код:
public OnPlayerDisconnect(playerid, reason)
{
// IRC
new leaveMsg[128], name[MAX_PLAYER_NAME], reasonMsg[8];
switch(reason)
{
case 0: reasonMsg = "Timeout/Crashed";
case 1: reasonMsg = "Leaving";
case 2: reasonMsg = "Kicked/Banned";
}
Your reasonMsg's array size is too small - 8.
Replace your code with this -
PHP код:
public OnPlayerDisconnect(playerid, reason)
{
// IRC
new leaveMsg[128], name[MAX_PLAYER_NAME], reasonMsg[15];
switch(reason)
{
case 0: reasonMsg = "Timeout/Crashed";
case 1: reasonMsg = "Leaving";
case 2: reasonMsg = "Kicked/Banned";
}
Re: array is too small [Problem] -
Naresh - 02.06.2014
Change i mean increase the [Number here for more letters] or try Making ur MSG Smaller..
Re: array is too small [Problem] -
Team_PRO - 02.06.2014
thanks i work.