Bracket help
#1

I'm getting tired from the brackets, someone can help ? it gives me errors because of wrong brackets

Code:
CMD:bizstats(playerid, params[])
{
	new string[128], status[16], status2[16];
	if(IsPlayerConnected(playerid))
	{
	if(PlayerInfo[playerid][pBiz]) format(status, sizeof(status), "%s", RBS(PlayerInfo[playerid][pBiz]));
	if(!PlayerInfo[playerid][pBiz]) format(status, sizeof(status), "None");

	if(PlayerInfo[playerid][pVBiz]) format(status2, sizeof(status2), "%s", RBS(PlayerInfo[playerid][pVBiz]));
	if(!PlayerInfo[playerid][pVBiz]) format(status2, sizeof(status2), "None");
	
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "_____________________________________________________");
	format(string, sizeof(string), "Businesses of %s", GetPlayerNameEx(playerid));
	SendClientMessage(playerid, COLOR_ORANGE, string);
	format(string, sizeof(string), "Business 1: %s | ID: %s | Level: %s | Status: %s | Products: %s | Vault: %s", RBT(PlayerInfo[playerid][pBiz]), RPBK(playerid), RPBL(playerid),status, RPBP(playerid), RPBM(playerid));
	SendClientMessage(playerid, COLOR_WHITE, string);
	format(string, sizeof(string), "Business 2: %s | ID: %s | Level: %s | Status: %s | Products: %s | Vault: %s", RBT(PlayerInfo[playerid][pVBiz]), RPVIPBK(playerid), RPVIPBL(playerid),status2, RPVIPBP(playerid), RPVIPBM(playerid));
	SendClientMessage(playerid, COLOR_FADE2, string);
	SendClientMessage(playerid, COLOR_LIGHTBLUE, "_____________________________________________________");
	}
	return 1;
}
Reply
#2

pawn Code:
CMD:bizstats(playerid, params[])
{
    new string[128], status[16], status2[16];
    if(IsPlayerConnected(playerid))
    {
    if(PlayerInfo[playerid][pBiz]) format(status, sizeof(status), "%s", RBS(PlayerInfo[playerid][pBiz]));
    if(!PlayerInfo[playerid][pBiz]) format(status, sizeof(status), "None");

    if(PlayerInfo[playerid][pVBiz]) format(status2, sizeof(status2), "%s", RBS(PlayerInfo[playerid][pVBiz]));
    if(!PlayerInfo[playerid][pVBiz]) format(status2, sizeof(status2), "None");
   
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "_____________________________________________________");
    format(string, sizeof(string), "Businesses of %s", GetPlayerNameEx(playerid));
    SendClientMessage(playerid, COLOR_ORANGE, string);
    format(string, sizeof(string), "Business 1: %s | ID: %s | Level: %s | Status: %s | Products: %s | Vault: %s", RBT(PlayerInfo[playerid][pBiz]), RPBK(playerid), RPBL(playerid),status, RPBP(playerid), RPBM(playerid));
    SendClientMessage(playerid, COLOR_WHITE, string);
    format(string, sizeof(string), "Business 2: %s | ID: %s | Level: %s | Status: %s | Products: %s | Vault: %s", RBT(PlayerInfo[playerid][pVBiz]), RPVIPBK(playerid), RPVIPBL(playerid),status2, RPVIPBP(playerid), RPVIPBM(playerid));
    SendClientMessage(playerid, COLOR_FADE2, string);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "_____________________________________________________");
    }
        }
    return 1;
}
pawn Code:
CMD:bizstats(playerid, params[])
{
    new string[128], status[16], status2[16];
        if(!IsPlayerConnected(playerid))
        return SendClientMessage(playerid,COLOR_RED,"Player not connected!");

    if(PlayerInfo[playerid][pBiz]) format(status, sizeof(status), "%s", RBS(PlayerInfo[playerid][pBiz]));
    if(!PlayerInfo[playerid][pBiz]) format(status, sizeof(status), "None");

    if(PlayerInfo[playerid][pVBiz]) format(status2, sizeof(status2), "%s", RBS(PlayerInfo[playerid][pVBiz]));
    if(!PlayerInfo[playerid][pVBiz]) format(status2, sizeof(status2), "None");
   
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "_____________________________________________________");
    format(string, sizeof(string), "Businesses of %s", GetPlayerNameEx(playerid));
    SendClientMessage(playerid, COLOR_ORANGE, string);
    format(string, sizeof(string), "Business 1: %s | ID: %s | Level: %s | Status: %s | Products: %s | Vault: %s", RBT(PlayerInfo[playerid][pBiz]), RPBK(playerid), RPBL(playerid),status, RPBP(playerid), RPBM(playerid));
    SendClientMessage(playerid, COLOR_WHITE, string);
    format(string, sizeof(string), "Business 2: %s | ID: %s | Level: %s | Status: %s | Products: %s | Vault: %s", RBT(PlayerInfo[playerid][pVBiz]), RPVIPBK(playerid), RPVIPBL(playerid),status2, RPVIPBP(playerid), RPVIPBM(playerid));
    SendClientMessage(playerid, COLOR_FADE2, string);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "_____________________________________________________");
    }
    return 1;
}
Reply
#3

Doesn't work, both of them
Reply
#4

The code is correct. Could you show us the errors?
Reply
#5

Quote:
Originally Posted by offon
View Post
The code is correct. Could you show us the errors?
With my original code i posted, ignore the warnings:
Code:
C:\Users\Mor\Desktop\CGRP v1.03\gamemodes\CGRP.pwn(1506) : error 017: undefined symbol "PlayerInfo"
C:\Users\Mor\Desktop\CGRP v1.03\gamemodes\CGRP.pwn(1507) : error 017: undefined symbol "PlayerInfo"
C:\Users\Mor\Desktop\CGRP v1.03\gamemodes\CGRP.pwn(1507) : error 017: undefined symbol "PlayerInfo"
C:\Users\Mor\Desktop\CGRP v1.03\gamemodes\CGRP.pwn(1514) : error 017: undefined symbol "PlayerInfo"
C:\Users\Mor\Desktop\CGRP v1.03\gamemodes\CGRP.pwn(1515) : error 017: undefined symbol "PlayerInfo"
C:\Users\Mor\Desktop\CGRP v1.03\gamemodes\CGRP.pwn(1515) : error 017: undefined symbol "PlayerInfo"
C:\Users\Mor\Desktop\CGRP v1.03\gamemodes\CGRP.pwn(1522) : error 017: undefined symbol "PlayerInfo"
C:\Users\Mor\Desktop\CGRP v1.03\gamemodes\CGRP.pwn(1523) : error 017: undefined symbol "PlayerInfo"
C:\Users\Mor\Desktop\CGRP v1.03\gamemodes\CGRP.pwn(1523) : error 017: undefined symbol "PlayerInfo"
C:\Users\Mor\Desktop\CGRP v1.03\gamemodes\CGRP.pwn(1529) : error 017: undefined symbol "PlayerInfo"
C:\Users\Mor\Desktop\CGRP v1.03\gamemodes\CGRP.pwn(1530) : error 017: undefined symbol "PlayerInfo"
C:\Users\Mor\Desktop\CGRP v1.03\gamemodes\CGRP.pwn(1530) : error 017: undefined symbol "PlayerInfo"
C:\Users\Mor\Desktop\CGRP v1.03\gamemodes\CGRP.pwn(1542) : error 017: undefined symbol "PlayerInfo"
C:\Users\Mor\Desktop\CGRP v1.03\gamemodes\CGRP.pwn(1543) : error 017: undefined symbol "PlayerInfo"
C:\Users\Mor\Desktop\CGRP v1.03\gamemodes\CGRP.pwn(1544) : error 017: undefined symbol "PlayerInfo"
C:\Users\Mor\Desktop\CGRP v1.03\gamemodes\CGRP.pwn(1551) : error 017: undefined symbol "PlayerInfo"
C:\Users\Mor\Desktop\CGRP v1.03\gamemodes\CGRP.pwn(1552) : error 017: undefined symbol "PlayerInfo"
C:\Users\Mor\Desktop\CGRP v1.03\gamemodes\CGRP.pwn(1552) : error 017: undefined symbol "PlayerInfo"
C:\Users\Mor\Desktop\CGRP v1.03\gamemodes\CGRP.pwn(1558) : error 017: undefined symbol "PlayerInfo"
C:\Users\Mor\Desktop\CGRP v1.03\gamemodes\CGRP.pwn(1559) : error 017: undefined symbol "PlayerInfo"
C:\Users\Mor\Desktop\CGRP v1.03\gamemodes\CGRP.pwn(1559) : error 017: undefined symbol "PlayerInfo"
C:\Users\Mor\Desktop\CGRP v1.03\gamemodes\CGRP.pwn(1571) : error 017: undefined symbol "PlayerInfo"
C:\Users\Mor\Desktop\CGRP v1.03\gamemodes\CGRP.pwn(1572) : error 017: undefined symbol "PlayerInfo"
C:\Users\Mor\Desktop\CGRP v1.03\gamemodes\CGRP.pwn(1573) : error 017: undefined symbol "PlayerInfo"
C:\Users\Mor\Desktop\CGRP v1.03\gamemodes\CGRP.pwn(19113) : warning 204: symbol is assigned a value that is never used: "captureowner"
C:\Users\Mor\Desktop\CGRP v1.03\gamemodes\CGRP.pwn(42893) : warning 217: loose indentation
C:\Users\Mor\Desktop\CGRP v1.03\gamemodes\CGRP.pwn(53049) : warning 217: loose indentation
C:\Users\Mor\Desktop\CGRP v1.03\gamemodes\CGRP.pwn(67793) : warning 217: loose indentation
C:\Users\Mor\Desktop\CGRP v1.03\gamemodes\CGRP.pwn(67881) : warning 217: loose indentation
C:\Users\Mor\Desktop\CGRP v1.03\gamemodes\CGRP.pwn(67977) : warning 217: loose indentation
C:\Users\Mor\Desktop\CGRP v1.03\gamemodes\CGRP.pwn(68061) : warning 217: loose indentation
C:\Users\Mor\Desktop\CGRP v1.03\gamemodes\CGRP.pwn(75166) : warning 217: loose indentation
C:\Users\Mor\Desktop\CGRP v1.03\gamemodes\CGRP.pwn(95165) : warning 203: symbol is never used: "DrivingTest"
C:\Users\Mor\Desktop\CGRP v1.03\gamemodes\CGRP.pwn(95165) : warning 203: symbol is never used: "Seconds"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


24 Errors.
Reply
#6

new PlayerInfo[MAX_PLAYERS][pInfo] on top.
Reply
#7

Quote:
Originally Posted by MatriXgaMer
View Post
new PlayerInfo[MAX_PLAYERS][pInfo] on top.
You forgot the ";" in your code

The problem isn't the bracket, if it was; you get 26 errors so do this:

First:
pawn Code:
new PlayerInfo[MAX_PLAYERS][pInfo];
then for loose indenation:
pawn Code:
#pragma tabsize 0
And for the symbols that aren't used, remove them from script and you get no errors & warnings.
Reply
#8

You didn't understand guy, if i use on bizstats command /* */ and mark it as unused errors are gone.
so it doesn't get belong
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)