if(strcmp(cmd, "/setstat", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, BLAU, "Benutze: /setstat [playerid] [statcode] [Betrag]");
SendClientMessage(playerid, BLAU, "|1 Level ");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, BLAU, "Benutze: /setstat [playerid] [statcode] [Betrag]");
SendClientMessage(playerid, BLAU, "|1 Level ");
return 1;
}
new stat;
stat = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, BLAU, "Benutze: /setstat [playerid] [statcode] [Betrag]");
SendClientMessage(playerid, BLAU, "|1 Level ");
return 1;
}
new string[128];
new amount;
amount = strval(tmp);
if (pInfo[playerid][pAdmin] >= 7)
{
switch (stat)
{
case 1:
{
pInfo[giveplayerid][pLevel] = amount;
SetPlayerScore(playerid, amount);
format(string, sizeof(string), "Der Spieler wurde auf Level %d gesetzt", amount);
}
default:
{
format(string, sizeof(string), "Ungültiger Statcode", amount);
}
}
SendClientMessage(playerid, ROT, string);
}
else
{
SendClientMessage(playerid, ROT, "Du bist nicht befugt!");
}
}//not valid id
}//not connected
}
return 1;
}