SA-MP Forums Archive
Whats the problem here ? ? ? - 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: Whats the problem here ? ? ? (/showthread.php?tid=434843)



Whats the problem here ? ? ? - yaron0600 - 04.05.2013

Whats the problem here ? ? ? When I remove it no errors and this is not the same lines just something wrong here... :

Код:
CMD:buysim(playerid, params[])
{
if(!IsPlayerInRangeOfPoint(playerid, 6, 920.421142, -1361.637084, 13.003659)) {
        SendClientMessageEx(playerid,COLOR_GREY,"   You are not at the Telecom Company Arena!");
    else if(GetPVarType(playerid, "Sim")) {
        SendClientMessageEx(playerid, COLOR_GREY, "   You are already have Sim!");
        return 1;
    }
				if (GetPlayerCash(playerid) >= 500)
				{
					PlayerInfo[playerid][pSim] = 1;
					format(string, sizeof(string), "Sim purchased, you can now look up other player's numbers.");
					SendClientMessageEx(playerid, COLOR_GRAD4, string);
					SendClientMessageEx(playerid, COLOR_WHITE, "HINT: Type /call /sms /text /t.");
 					if(PlayerInfo[playerid][pDonateRank] >= 1)
				    {
				        GivePlayerCash(playerid, -400);
				        SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: You have received 20 percent off this product. Instead of paying $500, you paid $400.");
					}
					else
					{
						GivePlayerCash(playerid, -500);
					}
				}
				else
				{
				SendClientMessageEx(playerid, COLOR_GRAD4, "You don't have the cash for the Sim!");
				}
}

Errors :

Код:
d:\Users\User\Desktop\Scriptv1 perfect\SSS\Script[ONLY TO YOU]\AMRP\gamemodes\NQRP.pwn(3769) : error 017: undefined symbol "ProxDetector"
d:\Users\User\Desktop\Scriptv1 perfect\SSS\Script[ONLY TO YOU]\AMRP\gamemodes\NQRP.pwn(3776) : error 017: undefined symbol "ProxDetector"
d:\Users\User\Desktop\Scriptv1 perfect\SSS\Script[ONLY TO YOU]\AMRP\gamemodes\NQRP.pwn(3783) : error 017: undefined symbol "ProxDetector"
d:\Users\User\Desktop\Scriptv1 perfect\SSS\Script[ONLY TO YOU]\AMRP\gamemodes\NQRP.pwn(3792) : error 017: undefined symbol "ProxDetector"
d:\Users\User\Desktop\Scriptv1 perfect\SSS\Script[ONLY TO YOU]\AMRP\gamemodes\NQRP.pwn(3806) : error 017: undefined symbol "ProxDetector"
d:\Users\User\Desktop\Scriptv1 perfect\SSS\Script[ONLY TO YOU]\AMRP\gamemodes\NQRP.pwn(3813) : error 017: undefined symbol "ProxDetector"
d:\Users\User\Desktop\Scriptv1 perfect\SSS\Script[ONLY TO YOU]\AMRP\gamemodes\NQRP.pwn(3817) : error 017: undefined symbol "GivePlayerCash"
d:\Users\User\Desktop\Scriptv1 perfect\SSS\Script[ONLY TO YOU]\AMRP\gamemodes\NQRP.pwn(3820) : error 017: undefined symbol "ProxDetector"
d:\Users\User\Desktop\Scriptv1 perfect\SSS\Script[ONLY TO YOU]\AMRP\gamemodes\NQRP.pwn(3827) : error 017: undefined symbol "ProxDetector"
d:\Users\User\Desktop\Scriptv1 perfect\SSS\Script[ONLY TO YOU]\AMRP\gamemodes\NQRP.pwn(3834) : error 017: undefined symbol "ProxDetector"
d:\Users\User\Desktop\Scriptv1 perfect\SSS\Script[ONLY TO YOU]\AMRP\gamemodes\NQRP.pwn(3849) : error 017: undefined symbol "GivePlayerCash"
d:\Users\User\Desktop\Scriptv1 perfect\SSS\Script[ONLY TO YOU]\AMRP\gamemodes\NQRP.pwn(3852) : error 017: undefined symbol "ProxDetector"
d:\Users\User\Desktop\Scriptv1 perfect\SSS\Script[ONLY TO YOU]\AMRP\gamemodes\NQRP.pwn(3859) : error 017: undefined symbol "ProxDetector"
d:\Users\User\Desktop\Scriptv1 perfect\SSS\Script[ONLY TO YOU]\AMRP\gamemodes\NQRP.pwn(3866) : error 017: undefined symbol "ProxDetector"
d:\Users\User\Desktop\Scriptv1 perfect\SSS\Script[ONLY TO YOU]\AMRP\gamemodes\NQRP.pwn(3880) : error 017: undefined symbol "ProxDetector"
d:\Users\User\Desktop\Scriptv1 perfect\SSS\Script[ONLY TO YOU]\AMRP\gamemodes\NQRP.pwn(3889) : error 017: undefined symbol "ProxDetector"
d:\Users\User\Desktop\Scriptv1 perfect\SSS\Script[ONLY TO YOU]\AMRP\gamemodes\NQRP.pwn(3901) : error 017: undefined symbol "ProxDetector"
d:\Users\User\Desktop\Scriptv1 perfect\SSS\Script[ONLY TO YOU]\AMRP\gamemodes\NQRP.pwn(3909) : error 017: undefined symbol "ProxDetector"
d:\Users\User\Desktop\Scriptv1 perfect\SSS\Script[ONLY TO YOU]\AMRP\gamemodes\NQRP.pwn(3934) : error 017: undefined symbol "ProxDetector"
d:\Users\User\Desktop\Scriptv1 perfect\SSS\Script[ONLY TO YOU]\AMRP\gamemodes\NQRP.pwn(3948) : error 017: undefined symbol "ProxDetector"
d:\Users\User\Desktop\Scriptv1 perfect\SSS\Script[ONLY TO YOU]\AMRP\gamemodes\NQRP.pwn(3956) : error 017: undefined symbol "GivePlayerCash"
d:\Users\User\Desktop\Scriptv1 perfect\SSS\Script[ONLY TO YOU]\AMRP\gamemodes\NQRP.pwn(3961) : error 017: undefined symbol "ProxDetector"
d:\Users\User\Desktop\Scriptv1 perfect\SSS\Script[ONLY TO YOU]\AMRP\gamemodes\NQRP.pwn(4138) : error 017: undefined symbol "GivePlayerCash"
d:\Users\User\Desktop\Scriptv1 perfect\SSS\Script[ONLY TO YOU]\AMRP\gamemodes\NQRP.pwn(4200) : warning 219: local variable "targetid" shadows a variable at a preceding level
d:\Users\User\Desktop\Scriptv1 perfect\SSS\Script[ONLY TO YOU]\AMRP\gamemodes\NQRP.pwn(4315) : error 017: undefined symbol "ProxDetector"
d:\Users\User\Desktop\Scriptv1 perfect\SSS\Script[ONLY TO YOU]\AMRP\gamemodes\NQRP.pwn(4335) : error 017: undefined symbol "ProxDetector"
d:\Users\User\Desktop\Scriptv1 perfect\SSS\Script[ONLY TO YOU]\AMRP\gamemodes\NQRP.pwn(4349) : error 017: undefined symbol "GivePlayerCash"

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


26 Errors.



Re: Whats the problem here ? ? ? - Yashas - 04.05.2013

You have forgotten to close a block with a brace.
Add one more } at the end of this function and its fixed.


Re: Whats the problem here ? ? ? - yaron0600 - 04.05.2013

Can you show the line I forgot ?


Re : Whats the problem here ? ? ? - Rayan_black - 04.05.2013

pawn Код:
CMD:buysim(playerid, params[])
{
if(!IsPlayerInRangeOfPoint(playerid, 6, 920.421142, -1361.637084, 13.003659)) {
        SendClientMessageEx(playerid,COLOR_GREY,"   You are not at the Telecom Company Arena!");
    }
    else if(GetPVarType(playerid, "Sim")) {
        SendClientMessageEx(playerid, COLOR_GREY, "   You are already have Sim!");
        return 1;
    }
                if (GetPlayerCash(playerid) >= 500)
                {
                    PlayerInfo[playerid][pSim] = 1;
                    format(string, sizeof(string), "Sim purchased, you can now look up other player's numbers.");
                    SendClientMessageEx(playerid, COLOR_GRAD4, string);
                    SendClientMessageEx(playerid, COLOR_WHITE, "HINT: Type /call /sms /text /t.");
                    if(PlayerInfo[playerid][pDonateRank] >= 1)
                    {
                        GivePlayerCash(playerid, -400);
                        SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: You have received 20 percent off this product. Instead of paying $500, you paid $400.");
                    }
                    else
                    {
                        GivePlayerCash(playerid, -500);
                    }
                }
                else
                {
                SendClientMessageEx(playerid, COLOR_GRAD4, "You don't have the cash for the Sim!");
                }
}
try this one.


Re: Whats the problem here ? ? ? - Yashas - 04.05.2013

Quote:
Originally Posted by yaron0600
Посмотреть сообщение
Can you show the line I forgot ?
The second brace you opened but did not close.
The most simple fix is add a } where required.


Re : Re: Whats the problem here ? ? ? - Rayan_black - 04.05.2013

Quote:
Originally Posted by Yashas
Посмотреть сообщение
The second brace you opened but did not close.
The most simple fix is add a } where required.
yeah, just copy the code I gave you I closed it for you


Re: Whats the problem here ? ? ? - iJumbo - 04.05.2013

pawn Код:
CMD:buysim(playerid, params[])
{//1
    if(!IsPlayerInRangeOfPoint(playerid, 6, 920.421142, -1361.637084, 13.003659))
    {//2
        SendClientMessageEx(playerid,COLOR_GREY,"   You are not at the Telecom Company Arena!");
        else if(GetPVarType(playerid, "Sim"))
        {//3
            SendClientMessageEx(playerid, COLOR_GREY, "   You are already have Sim!");
            return 1;
        }//3
        if (GetPlayerCash(playerid) >= 500)
        {//4
            PlayerInfo[playerid][pSim] = 1;
            format(string, sizeof(string), "Sim purchased, you can now look up other player's numbers.");
            SendClientMessageEx(playerid, COLOR_GRAD4, string);
            SendClientMessageEx(playerid, COLOR_WHITE, "HINT: Type /call /sms /text /t.");
            if(PlayerInfo[playerid][pDonateRank] >= 1)
            {//5
                GivePlayerCash(playerid, -400);
                SendClientMessageEx(playerid, COLOR_YELLOW, "VIP: You have received 20 percent off this product. Instead of paying $500, you paid $400.");
            }//5
            else
            {//6
                GivePlayerCash(playerid, -500);
            }//6
        }//4
        else
        {//7
            SendClientMessageEx(playerid, COLOR_GRAD4, "You don't have the cash for the Sim!");
        }//7
    }//2
}//1
a better tabulation help