Hier der Error:
C:\Users\Lukas\Desktop\Scripting\Mein Server\gamemodes\Somalia.pwn(449) : error 029: invalid expression, assumed zero
C:\Users\Lukas\Desktop\Scripting\Mein Server\gamemodes\Somalia.pwn(449) : error 035: argument type mismatch (argument 2)
Hier in der Zeile 25
Der Command:
ocmd:gibrang(playerid,params[])
{
new pID;
new gibrang;
if(sscanf(params, "ud", pID, gibrang))
{
return SendClientMessage(playerid,ROT,"Nutze: /gibrang [Playerid] [Rank]");
}
if(!IsPlayerConnected(pID))
{
return SendClientMessage(playerid,ROT,"Kein Spieler mit angegebener ID Online");
}
//if(Player[playerid][Leader]==0)
if(hatPlayerRang(playerid,2))
{
return SendClientMessage(playerid,ROT,"Du bist kein Leader einer Fraktion!");
}
else
{
new sendername[MAX_PLAYERS];
new givename[MAX_PLAYERS];
new string[128];
new string2[128];
new newrank = gibrang;
if(isPlayerInFrakt(playerid,1)) && hatPlayerRang(playerid,"Rang",2) && isPlayerInFrakt(pID,1)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), ">> Leader %s hat dir Rank %d erteilt.", sendername, newrank);
SendClientMessage(pID, ROT, string);
GetPlayerName(pID, givename, sizeof(givename));
format(string2, sizeof(string2), ">> Du hast %s auf Rank %d gesetzt.", givename, newrank);
SendClientMessage(playerid, ROT, string2);
//Player[pID][Rank] = newrank;
SetPVarInt(pID,"Rang", newrank);
}
}
return 1;
}
Und so sieht der rest aus wegen rang:
#define rangname1 "Azubi"
#define rangname2 "Leader"
stock hatPlayerRang(playerid,rang)
{
if(GetPVarInt(playerid,"Rang")>=rang)return 1;
return 0;
}
Unter Load Account
SetPVarInt(playerid,"Rang",dini_Int(Spielerdatei,"Rang"));
Und unter Spieler Speichern
dini_IntSet(Spielerdatei,"Rang",GetPVarInt(playerid,"Rang"));