23.04.2012, 10:47
How to create this command in
/prison [ID/Name of Player] [Minutes]
/prison [ID/Name of Player] [Minutes]
pawn Код:
//-----------------------------------[PRISON]-------------------------------------------------------------------------
if(strcmp(cmd, "/prison",true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] < 2)
{
SendClientMessage(playerid, WHITE, ""COL_RED"|CityBot|{FFFFFF} Niste ovlasteni da koristite tu komandu.");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koristi: /prison [ID Igraca/Deo Imena]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerNameEx(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* Stavili ste {48E31C}%s-a u "COL_WHITE"Areu-51.", giveplayer);
SendClientMessage(playerid, ZELENKASTA, string);
format(string, sizeof(string), "* Admin {48E31C}%s "COL_WHITE"vas je stavio u {48E31C}Areu-51.", sendername);
SendClientMessage(giveplayerid, ZELENKASTA, string);
GameTextForPlayer(giveplayerid, "~w~Dobrodosli u ~n~~r~Area-51", 5000, 3);
WantedPoints[giveplayerid] = 0;
WantedLevel[giveplayerid] = 0;
PlayerInfo[giveplayerid][pJailed] = 2;
PlayerInfo[giveplayerid][pJailTime] = 3600;
SetPlayerPos(giveplayerid, 107.2300,1920.6311,18.5208);
SetPlayerWorldBounds(giveplayerid, 337.5694,101.5826,1940.9759,1798.7453); //285.3481,96.9720,1940.9755,1799.0811
SetPlayerInterior(giveplayerid,0);
PlayerInfo[giveplayerid][pInt] = 0;
format(string, 256, ""COL_RED"|CityBot|{FFFFFF} %s "COL_WHITE"je zatvoren od Admin "COL_RED"%s.", giveplayer, sendername);
ABroadCast(COLOR_WHITE,string,1);
format(string, sizeof(string), "Area51 | %s je stavljen u areu od %s-a", giveplayer, sendername);
printf("%s",string);
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Igrac je offline!");
return 1;
}
}
return 1;
}