if(strcmp(cmd, "/prison", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, Rot , "[Benutze]: /prison [ID] [Zeit]");
return 1;
}
new playa;
new money;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
money = strval(tmp);
new grund[100];
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
while ((idx < length) && ((idx - offset) < (sizeof(grund) - 1)))
{
grund[idx - offset] = cmdtext[idx];
idx++;
}
grund[idx - offset] = EOS;
if (PlayerInfo[playerid][pAdmin] >= 1338)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "[AdmCmd]: Du hast %s für %d Minuten ins Prison eingesperrt. Grund: %s", giveplayer, money, (grund));
SendClientMessage(playerid, Leuchtrot, string);
format(string, sizeof(string), "Du wurdest von Admin %s für %d Minuten wegen %s ins Prison gesteckt", sendername, money, (grund));
SendClientMessage(playa, Leuchtrot, string);
ResetPlayerWeapons(playa);
WantedPoints[playa] = 0;
PlayerInfo[playa][pJailed] = 1;
PlayerInfo[playa][pJailTime] = money*60;
SetPlayerInterior(playa, 0);
SetPlayerPos(playa,864.91, -2077.61, 927.41);
SendClientMessage(playa, COLOR_LIGHTBLUE, "Um deine Absitzzeit anzusehen benutze{FFFFFF} /prisontime.");
}
}
}
else
{
SendClientMessage(playerid, Rot , "Du bist kein befugter Admin!");
}
}
return 1;
}
Ungetestet! sollte aber rein Theoretisch alles klappen.
MFG
CutX