18.09.2012, 14:59
pawn Код:
command(makeowner, playerid, params[])
{
new Confirm[128], id, string[128], string1[128];
if(sscanf(params, "dz", id, Confirm))
{
if(Player[playerid][FactionRank] == 7 && Factions[Player[playerid][Faction]][FOwner] == GetName(playerid))
{
format(string1, sizeof(string1), "You wanna make %s the owner of your faction? [Yes? Type '/makeowner [id] Confirm'] ", GetName(id));
SendClientMessage(playerid, WHITE, string1);
}
}
else
{
if(Player[playerid][FactionRank] == 7 && Factions[Player[playerid][Faction]][FOwner] == GetName(playerid))
{
format(string, sizeof(string), "Factions/Faction_%d.ini", id);
if(strcmp(Confirm, "Confirm", true) == 0)
{
if(Player[id][Faction] == Player[playerid][Faction])
{
format(Factions[Player[playerid][Faction]][FOwner], 255, "%s", GetName(id));
format(string1, sizeof(string1), "You made %s owner of the faction, you are now %s.", GetName(id), Factions[Player[id][Faction]][RankName6]);
SendClientMessage(playerid, WHITE, string1);
Player[playerid][FactionRank] = 6;
format(string1, sizeof(string1), "%s made you owner of the faction, he is now %s.", GetName(playerid), Factions[Player[id][Faction]][RankName6]);
SendClientMessage(id, ADMINBLUE, string1);
Player[id][FactionRank] = 7;
SaveFaction(Player[id][Faction]);
SavePlayerData(playerid);
SavePlayerData(id);
}
else
{
SCM(playerid, RED, "This player is not in your faction.");
}
}
}
}
return 1;
}
Код:
C:\Users\Stefan Dorst\Desktop\Scratch RolePlay\gamemodes\RP.pwn(528) : error 033: array must be indexed (variable "GetName") C:\Users\Stefan Dorst\Desktop\Scratch RolePlay\gamemodes\RP.pwn(536) : error 033: array must be indexed (variable "GetName") C:\Users\Stefan Dorst\Desktop\Scratch RolePlay\gamemodes\RP.pwn(2834) : error 006: must be assigned to an array Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 3 Errors.
Error line's are the same it's:
pawn Код:
if(Player[playerid][FactionRank] == 7 && Factions[Player[playerid][Faction]][FOwner] == GetName(playerid))
{
pawn Код:
stock GetName(playerid)
{
new Name[MAX_PLAYER_NAME];
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, Name, sizeof(Name));
}
else
{
Name = "Disconnected/Nothing";
}
return Name;
}