Array must be indexed "PlayerRank"
#1

Код:
CMD:d(playerid, params[])
	{
	if(PlayerOrg[playerid] == 0) return SendClientMessage(playerid, -1, "ur not in a faction fag");
	if(PlayerOrg[playerid] == 1 || PlayerOrg[playerid] == 2)
	{
	new msg[128], playername[MAX_PLAYER_NAME];
	if (sscanf(params, "s[100]", msg)) return SendClientMessage(playerid,COLOR_WHITE,"Usage: /d [message]");
	GetPlayerName(playerid, playername, sizeof(playername));
	if(PlayerOrg[playerid] == 1)
	{
	if(PlayerRank[playerid] == 1) format(msg, sizeof(msg), "[DEP] pddrank 1 %s: %s", playername, msg);
	if(PlayerRank[playerid] == 2) format(msg, sizeof(msg), "[DEP] pdrank 2 %s: %s", playername, msg);
	if(PlayerRank[playerid] == 3) format(msg, sizeof(msg), "[DEP] pdrank 3 %s: %s", playername, msg);
	if(PlayerRank[playerid] == 4) format(msg, sizeof(msg), "[DEP] pdrank 4 %s: %s", playername, msg);
	if(PlayerRank[playerid] == 5) format(msg, sizeof(msg), "[DEP] pdrank 5 %s: %s", playername, msg);
	if(PlayerRank[playerid] == 6) format(msg, sizeof(msg), "[DEP] pdrank 6 %s: %s", playername, msg);
	}
	if(PlayerOrg[playerid] == 2)
	{
	if(PlayerRank[playerid] == 1) format(msg, sizeof(msg), "[DEP] pdrank 1 %s: %s", playername, msg);
	if(PlayerRank[playerid] == 2) format(msg, sizeof(msg), "[DEP] pdrank 2 %s: %s", playername, msg);
	if(PlayerRank[playerid] == 3) format(msg, sizeof(msg), "[DEP] pdrank 3 %s: %s", playername, msg);
	if(PlayerRank[playerid] == 4) format(msg, sizeof(msg), "[DEP] pdrank 4 %s: %s", playername, msg);
	if(PlayerRank[playerid] == 5) format(msg, sizeof(msg), "[DEP] pdrank 5 %s: %s", playername, msg);
	if(PlayerRank[playerid] == 6) format(msg, sizeof(msg), "[DEP] pdrank 6 %s: %s", playername, msg);
	}
	SendClientMessageToOrg("SASD", -1, msg);
	SendClientMessageToOrg("LSPD", -1, msg);
	}
	return 1;
	}
help pls
Reply
#2

Show me the enum for PlayerRank
Reply
#3

PlayerInfo[PlayerRank][playerid] maybe
Reply
#4

it should be something like this:

pawn Код:
enum PlayerData
{
    ID,
    Password[129],
    PlayerRank
}
new pInfo[MAX_PLAYERS][PlayerData];
The way you use this this:

pawn Код:
pInfo[playerid][PlayerRank]

if(pInfo[playerid][PlayerRank] == 1) format(msg, sizeof(msg), "[DEP] pddrank 1 %s: %s", playername, msg);
Reply
#5

Kind of building off of someone elses filterscript so not to familiar with that, but this is what i could scavenge:
also, im using DINI.

Код:
 enum Orgs
    {
    Name[32],
    Leader[24],
    Skin,
    Float:X,
    Float:Y,
    Float:Z,
    Weapons[3],
    Ammo[3],
    Vehicles[MAX_ORG_VEHICLES],
    VehiclesCreated,
    Text3D:OrgLabel,
    Zones[MAX_ZONES_PER_ORG],
    Float:ZoneMinX[MAX_ZONES_PER_ORG],
    Float:ZoneMinY[MAX_ZONES_PER_ORG],
    Float:ZoneMaxX[MAX_ZONES_PER_ORG],
    Float:ZoneMaxY[MAX_ZONES_PER_ORG],
    ZoneColor[MAX_ZONES_PER_ORG],
    ZonesCreated,
    };

    new Organization[MAX_ORGS][Orgs];

    new PlayerOrg[MAX_PLAYERS];
    new PlayerLeader[MAX_PLAYERS];
    new PlayerRank[MAX_PLAYERS][28];
    new Requesting[MAX_PLAYERS];
    new CollectedWage[MAX_PLAYERS];
Reply
#6

Quote:
Originally Posted by Phil_Cutcliffe
Посмотреть сообщение
Show me the enum for PlayerRank
It doesn't necesarilly have to be an enum;

Show us where you define/create the array PlayerRank.
Reply
#7

Quote:
Originally Posted by HenrySunseri
Посмотреть сообщение
Kind of building off of someone elses filterscript so not to familiar with that, but this is what i could scavenge:
also, im using DINI.

Код:
 enum Orgs
    {
    Name[32],
    Leader[24],
    Skin,
    Float:X,
    Float:Y,
    Float:Z,
    Weapons[3],
    Ammo[3],
    Vehicles[MAX_ORG_VEHICLES],
    VehiclesCreated,
    Text3D:OrgLabel,
    Zones[MAX_ZONES_PER_ORG],
    Float:ZoneMinX[MAX_ZONES_PER_ORG],
    Float:ZoneMinY[MAX_ZONES_PER_ORG],
    Float:ZoneMaxX[MAX_ZONES_PER_ORG],
    Float:ZoneMaxY[MAX_ZONES_PER_ORG],
    ZoneColor[MAX_ZONES_PER_ORG],
    ZonesCreated,
    };

    new Organization[MAX_ORGS][Orgs];

    new PlayerOrg[MAX_PLAYERS];
    new PlayerLeader[MAX_PLAYERS];
    new PlayerRank[MAX_PLAYERS][28];
    new Requesting[MAX_PLAYERS];
    new CollectedWage[MAX_PLAYERS];
I'm pretty sure you don't need the [28] on the end there if your using it the way you are?
Reply
#8

new PlayerRank[MAX_PLAYERS][28]; delete [28]
Reply
#9

deleted it and now i have a few errors "must be assigned to an array":
these are all scattered throughout the script
PlayerRank[playerid] = "None";
PlayerRank[playerid] = string2;
Reply
#10

Solved this for him.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)