mit PlayerInfo zb pRank
hier mel zb
new PlayerInfo[MAX_PLAYERS][pInfo];
enum pInfo
{
pRank
};
public OnPlayerConnect(playerid)
{
PlayerInfo[playerid][pRank] = 0;
return 1;
}
if(strcmp(cmdtext,"/test",true) == 0)
{
if(PlayerInfo[playerid][pRank] == 1)
{
SendClientMessage(playerid,0xFFFFFFFF,"toll wa freust dich jetzt ? :D");
}
if(strcmp(cmd, "/giverank", true) == 0 || strcmp(cmd, "/giverang", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "NUTZUNG: /giverang [playerid] [Rang(1-6)]");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
if(level > 12 || level < 0) { SendClientMessage(playerid, COLOR_GREY, " Ränge gehen nur von 1 bis 12!"); return 1; }
if (PlayerInfo[playerid][pLeader] >= 1)
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
if(PlayerInfo[playerid][pLeader] == PlayerInfo[para1][pMember] && PlayerInfo[playerid][pAdmin] <= 4)
{
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pRank] = level;
format(string, sizeof(string), " Du wurdest von %s zum Rang %d gemacht",sendername,level);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), " Du hast %s Rang %d gegeben.",giveplayer,level);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
else if(PlayerInfo[playerid][pLeader] == PlayerInfo[para1][pLeader])
{
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pRank] = level;
format(string, sizeof(string), " Du wurdest von %s zum Rang %d gemacht",sendername,level);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), " Du hast %s Rang %d gegeben.",giveplayer,level);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
else if(PlayerInfo[playerid][pAdmin] >= 1337)
{
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pRank] = level;
format(string, sizeof(string), " Du wurdest von %s zum Rang %d gemacht",sendername,level);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), " Du hast %s Rang %d gegeben.",giveplayer,level);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Du bist nicht der Leader des Spielers!");
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " Du darfst diesen Befehl nicht benutzen(Nur Leader)!");
}
}
return 1;
}
//fertig
//wäre jetzt zb für gf aber naja selfmade und gf ist eh das gleiche von code her weiß auch net warum manch user damit solch probleme haben ^^