Üdv van egy olyan parancsom (afterlife edit) hogy /ajail ez így néz ki:
if(strcmp(cmd, \"/ajail\", true) == 0 || strcmp(cmd, \"/aj\", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, \"RPG: /ajail [JátékosID/NévRészlet] [mp] [indok]\");
return 1;
}
new playa;
new money;
new randomaj;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
money = strval(tmp);
if (Admin(playerid, 1) || PlayerInfo[playerid][orokas] >= 1)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= \' \'))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_LIGHTBLUE, \" RPG: /ajail [JátékosID/NévRészlet] [mp] [indok]\");
return 1;
}
format(string, sizeof(string), \"AdminJail-be zártad %s.\", rag(giveplayer,3));
SendClientMessage(playerid, COLOR_LIGHTRED, string);
SafeResetPlayerWeapons(playa);
WantedPoints[playa] = 0;
PlayerInfo[playa][pJailed] = 1;
PlayerInfo[playa][pJailTime] = money*60;
PlayerInfo[playa][pInt] = 0;
PlayerInfo[playa][Ajail] = 1;
randomaj = random(sizeof(RandomAdminJailSpawn));
SetPlayerPos(playa, RandomAdminJailSpawn[randomaj][0], RandomAdminJailSpawn[randomaj][1], RandomAdminJailSpawn[randomaj][2]);
SetPlayerInterior(playa,10);
//SetPlayerPos(playa, -228.75657653809,976.13928222656,22.283348083496);
format(string, sizeof(string), \"%s AdminJailt kapott %s által | Oka: %s | Idõtartam: %d mp\",rag(giveplayer,3), sendername, (result),PlayerInfo[playa][pJailTime] = money);
SendClientMessageToAll(0xFF0606FF, string);
format(string, sizeof(string), \"%s AdminJailt kapott %s által. | Oka: %s\",rag(giveplayer,3), sendername, (result),PlayerInfo[playa][pJailTime] = money);
ABroadCast(COLOR_ADMIN,string,1);
new nev[32];
GetPlayerName(playerid, nev, sizeof(nev));
new h,mi,s,y,m,d;
getdate(y,m,d);
gettime(h,mi,s);
format(stringx,sizeof(stringx), \"[%d/%d/%d][%d:%d:%d][Adminjail] %s adminjailt kapott %s által | Oka: %s, Idõtartam: %d mp \",y,m,d,h,mi,s,rag(giveplayer,3), sendername, (result),PlayerInfo[playa][pJailTime] = money);
LoOoG(stringx);
format(string, sizeof(string), \"%s AdminJail-be került %s által Oka: %s\", giveplayer, sendername, (result));
printf(\"%s\",string);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, \"Nem vagy admin/adminsegéd!\");
}
}
return 1;
}
Na most nekem az kéne ha egy admin beírja azt a parancsot, hogy /kikvannak vagy vmi ilyesmit akkor ki írná neki azt hogy:
Jelenleg Õk vannak ajailban:
%s : %d (név, hátralévõ idõ)
Elõre is köszi