SA-MP Forums Archive
Help me with this error - 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: Help me with this error (/showthread.php?tid=628249)



Help me with this error - BigGreen - 08.02.2017

Hello i'm having problem with this script i just downloaded and i wanted to fix something that wasn't working within the script after i had fixed it i get these error's

Код:
C:\Users\John\Desktop\Prison RP\gamemodes\PRP.pwn(9051) : warning 202: number of arguments does not match definition
C:\Users\John\Desktop\Prison RP\gamemodes\PRP.pwn(9055) : error 055: start of function body without function header
C:\Users\John\Desktop\Prison RP\gamemodes\PRP.pwn(9056) : error 010: invalid function or declaration
C:\Users\John\Desktop\Prison RP\gamemodes\PRP.pwn(9065) : error 010: invalid function or declaration
C:\Users\John\Desktop\Prison RP\gamemodes\PRP.pwn(9076) : error 010: invalid function or declaration
C:\Users\John\Desktop\Prison RP\gamemodes\PRP.pwn(9077) : error 010: invalid function or declaration
C:\Users\John\Desktop\Prison RP\gamemodes\PRP.pwn(961) : warning 204: symbol is assigned a value that is never used: "IsolationVW"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
I really need this fixed please help


Re: Help me with this error - X337 - 08.02.2017

Show us codes that causing those errors/warnings.


Re: Help me with this error - DandyCorleone - 08.02.2017

give me your code in line 9055-9077


Re: Help me with this error - BigGreen - 08.02.2017

Quote:
Originally Posted by DandyCorleone
Посмотреть сообщение
give me your code in line 9055-9077
Код:
COMMAND:securitycamera(playerid, params[])
{
	if(PlayerStat[playerid][FactionID] != 1) return SendClientMessage(playerid, GREY, "You are not a Prison Guard.");
	//if(IsPlayerInRangeOfPoint(playerid, 8.0, -25.6415,-374.0972,14.9761))
	else if(!IsPlayerInRangeOfPoint(playerid, 434.2499,1521.3287,1001.0000))
    SendClientMessage(playerid, GREY, "You are not at the Control Room.");
    return 1;
}
	{
		if(PlayerStat[playerid][SecurityCameraStatus] == 1)
		{
		   PlayerStat[playerid][SecurityCameraStatus] = 0;
		   TogglePlayerControllable(playerid, 1);
		   SetCameraBehindPlayer(playerid);
		   GameTextForPlayer(playerid, "~r~Security Camera Disabled.", 3000, 4);
		   PlayerStat[playerid][SecurityCameraNumber] = 0;
		   TextDrawHideForPlayer(playerid, SecurityCameraTextDraw);
		}
		else if(PlayerStat[playerid][SecurityCameraStatus] == 0)
		{
		   PlayerStat[playerid][SecurityCameraStatus] = 1;
		   TogglePlayerControllable(playerid, 0);
		   SetPlayerCameraPos(playerid, -19.8700,-335.8774,10.7141);
		   SetPlayerCameraLookAt(playerid, 7.8794,-371.8924,6.4286);
		   PlayerStat[playerid][SecurityCameraNumber] = 1;
		   GameTextForPlayer(playerid, "~g~Security Camera Enabled.", 3000, 4);
           TextDrawShowForPlayer(playerid, SecurityCameraTextDraw);
		}
    }
    else return SendClientMessage(playerid, GREY, "You are not at the Control Room.");
    return 1;
}
This is what it gives me


Re: Help me with this error - DandyCorleone - 08.02.2017

try This

PHP код:

COMMAND
:securitycamera(playeridparams[])
{
    if(
PlayerStat[playerid][FactionID] != 1) return SendClientMessage(playeridGREY"You are not a Prison Guard.");
    
//if(IsPlayerInRangeOfPoint(playerid, 8.0, -25.6415,-374.0972,14.9761))
    
else if(!IsPlayerInRangeOfPoint(playerid434.2499,1521.3287,1001.0000)) return SendClientMessage(playeridGREY"You are not at the Control Room.");
        if(
PlayerStat[playerid][SecurityCameraStatus] == 1)
        {
           
PlayerStat[playerid][SecurityCameraStatus] = 0;
           
TogglePlayerControllable(playerid1);
           
SetCameraBehindPlayer(playerid);
           
GameTextForPlayer(playerid"~r~Security Camera Disabled."30004);
           
PlayerStat[playerid][SecurityCameraNumber] = 0;
           
TextDrawHideForPlayer(playeridSecurityCameraTextDraw);
        }
        else if(
PlayerStat[playerid][SecurityCameraStatus] == 0)
        {
           
PlayerStat[playerid][SecurityCameraStatus] = 1;
           
TogglePlayerControllable(playerid0);
           
SetPlayerCameraPos(playerid, -19.8700,-335.8774,10.7141);
           
SetPlayerCameraLookAt(playerid7.8794,-371.8924,6.4286);
           
PlayerStat[playerid][SecurityCameraNumber] = 1;
           
GameTextForPlayer(playerid"~g~Security Camera Enabled."30004);
           
TextDrawShowForPlayer(playeridSecurityCameraTextDraw);
        }
    else return 
SendClientMessage(playeridGREY"You are not at the Control Room.");
    return 
1;




Re: Help me with this error - BigGreen - 08.02.2017

Quote:
Originally Posted by DandyCorleone
Посмотреть сообщение
try This

PHP код:

COMMAND
:securitycamera(playeridparams[])
{
    if(
PlayerStat[playerid][FactionID] != 1) return SendClientMessage(playeridGREY"You are not a Prison Guard.");
    
//if(IsPlayerInRangeOfPoint(playerid, 8.0, -25.6415,-374.0972,14.9761))
    
else if(!IsPlayerInRangeOfPoint(playerid434.2499,1521.3287,1001.0000)) return SendClientMessage(playeridGREY"You are not at the Control Room.");
        if(
PlayerStat[playerid][SecurityCameraStatus] == 1)
        {
           
PlayerStat[playerid][SecurityCameraStatus] = 0;
           
TogglePlayerControllable(playerid1);
           
SetCameraBehindPlayer(playerid);
           
GameTextForPlayer(playerid"~r~Security Camera Disabled."30004);
           
PlayerStat[playerid][SecurityCameraNumber] = 0;
           
TextDrawHideForPlayer(playeridSecurityCameraTextDraw);
        }
        else if(
PlayerStat[playerid][SecurityCameraStatus] == 0)
        {
           
PlayerStat[playerid][SecurityCameraStatus] = 1;
           
TogglePlayerControllable(playerid0);
           
SetPlayerCameraPos(playerid, -19.8700,-335.8774,10.7141);
           
SetPlayerCameraLookAt(playerid7.8794,-371.8924,6.4286);
           
PlayerStat[playerid][SecurityCameraNumber] = 1;
           
GameTextForPlayer(playerid"~g~Security Camera Enabled."30004);
           
TextDrawShowForPlayer(playeridSecurityCameraTextDraw);
        }
    else return 
SendClientMessage(playeridGREY"You are not at the Control Room.");
    return 
1;

The code you gave works but i still some how get these now
Код:
C:\Users\John\Desktop\Prison RP\gamemodes\PRP.pwn(9051) : warning 202: number of arguments does not match definition
C:\Users\John\Desktop\Prison RP\gamemodes\PRP.pwn(9052) : warning 217: loose indentation
C:\Users\John\Desktop\Prison RP\gamemodes\PRP.pwn(9071) : warning 217: loose indentation
C:\Users\John\Desktop\Prison RP\gamemodes\PRP.pwn(9072) : warning 217: loose indentation
C:\Users\John\Desktop\Prison RP\gamemodes\PRP.pwn(961) : warning 204: symbol is assigned a value that is never used: "IsolationVW"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Warnings.
and for the warning 204 i find this line IsolationVW = 0;


Re: Help me with this error - DandyCorleone - 08.02.2017

recommendation

PHP код:
COMMAND:securitycamera(playeridparams[]) 

    if(
PlayerStat[playerid][FactionID] != 1) return SendClientMessage(playeridGREY"You are not a Prison Guard."); 
    if(!
IsPlayerInRangeOfPoint(playerid434.2499,1521.3287,1001.0000)) return SendClientMessage(playeridGREY"You are not at the Control Room."); 
        if(
PlayerStat[playerid][SecurityCameraStatus] == 1
        { 
           
PlayerStat[playerid][SecurityCameraStatus] = 0
           
TogglePlayerControllable(playerid1); 
           
SetCameraBehindPlayer(playerid); 
           
GameTextForPlayer(playerid"~r~Security Camera Disabled."30004); 
           
PlayerStat[playerid][SecurityCameraNumber] = 0
           
TextDrawHideForPlayer(playeridSecurityCameraTextDraw); 
        } 
        else if(
PlayerStat[playerid][SecurityCameraStatus] == 0
        { 
           
PlayerStat[playerid][SecurityCameraStatus] = 1
           
TogglePlayerControllable(playerid0); 
           
SetPlayerCameraPos(playerid, -19.8700,-335.8774,10.7141); 
           
SetPlayerCameraLookAt(playerid7.8794,-371.8924,6.4286); 
           
PlayerStat[playerid][SecurityCameraNumber] = 1
           
GameTextForPlayer(playerid"~g~Security Camera Enabled."30004); 
           
TextDrawShowForPlayer(playeridSecurityCameraTextDraw); 
        } 
    return 
1




Re: Help me with this error - X337 - 08.02.2017

Код:
else if(!IsPlayerInRangeOfPoint(playerid, 434.2499,1521.3287,1001.0000)) return SendClientMessage(playerid, GREY, "You are not at the Control Room."); 

C:\Users\John\Desktop\Prison RP\gamemodes\PRP.pwn(9051) : warning 202: number of arguments does not match definition
Correct parameters for IsPlayerInRangeOfPoint are (playerid, Float:range, Float:x, Float:y, Float:z)

Код:
C:\Users\John\Desktop\Prison RP\gamemodes\PRP.pwn(9052) : warning 217: loose indentation
C:\Users\John\Desktop\Prison RP\gamemodes\PRP.pwn(9071) : warning 217: loose indentation
C:\Users\John\Desktop\Prison RP\gamemodes\PRP.pwn(9072) : warning 217: loose indentation
Fix the indentation.

Код:
C:\Users\John\Desktop\Prison RP\gamemodes\PRP.pwn(961) : warning 204: symbol is assigned a value that is never used: "IsolationVW"
You can simply remove "IsolationVW" variable, it's unused.

Edit:
Quote:
Originally Posted by DandyCorleone
Посмотреть сообщение
recommendation

PHP код:
... 
Sorry, but please tell him which lines you've changed and also give an explanation why does he got those warnings.
And also in your code:
Код:
if(!IsPlayerInRangeOfPoint(playerid, 434.2499,1521.3287,1001.0000))
It will still trigger "number of arguments does not match definition" warning.


Re: Help me with this error - BigGreen - 08.02.2017

Quote:
Originally Posted by X337
Посмотреть сообщение
Код:
else if(!IsPlayerInRangeOfPoint(playerid, 434.2499,1521.3287,1001.0000)) return SendClientMessage(playerid, GREY, "You are not at the Control Room."); 

C:\Users\John\Desktop\Prison RP\gamemodes\PRP.pwn(9051) : warning 202: number of arguments does not match definition
Correct parameters for IsPlayerInRangeOfPoint are (playerid, Float:range, Float, Float:y, Float:z)

Код:
C:\Users\John\Desktop\Prison RP\gamemodes\PRP.pwn(9052) : warning 217: loose indentation
C:\Users\John\Desktop\Prison RP\gamemodes\PRP.pwn(9071) : warning 217: loose indentation
C:\Users\John\Desktop\Prison RP\gamemodes\PRP.pwn(9072) : warning 217: loose indentation
Fix the indentation.

Код:
C:\Users\John\Desktop\Prison RP\gamemodes\PRP.pwn(961) : warning 204: symbol is assigned a value that is never used: "IsolationVW"
You can simply remove "IsolationVW" variable, it's unused.
Those worked but after i removed "IsolationVW"

this command begins not to work before it worked fine
http://pastebin.com/ZSpGpvSg


Re: Help me with this error - BigGreen - 08.02.2017

bump