[Pomoc]Par stvari

Započeo ., Septembar 14, 2011, 14:31:52 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

.

*

Skripta koju koristim:San Andreas RPG/DM Edit
Detaljan opis problema:Ovako prva stvar je da bih htio napraviti kada se igraca stavi u zatvor da ima ispod textdraw na dnu gdje bi mu pisalo kolko jos vremena u jailu ima.I druga stvar je kako da napravim da kada koristim komandu naprimjer /rangehp da postavim zeljeni hp svim igracima oko sebe.Jos zadnje kako da napravimi na komandi /healall da kucam /healall [1-100] i postavim zdravlje svima od 1-100
Dio skripte: -//-
Neke slike/video za lakse dobivanje pomoci(neobavezno): -//-

evo ti ovo za zatvor...


Ovo stavi na vrh scripte

forward vrijemez();
new vrijemeza;


Evo ti moj /arrest,samo prevedi ovo na engleskom (( znaci stavi ovo umjesto svog /arrest ))

if(strcmp(cmd, "/arrest", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
if(gTeam[playerid] == 2  || IsACop(playerid))
{
if(OnDuty[playerid] != 1 && PlayerInfo[playerid][pMember] == 1)
{
    SendClientMessage(playerid, COLOR_GREY, "   You are not on Duty!");
    return 1;
}
        if(!PlayerToPoint(6.0, playerid, 268.3327,77.8972,1001.0391))
{// Jail spot
    SendClientMessage(playerid, COLOR_GREY, "   You are not near the Jail, can't Arrest !");
    return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
return 1;
}
moneys = strval(tmp);
if(moneys < 1 || moneys > 99999) { SendClientMessage(playerid, COLOR_GREY, "   Jail Price can't be below $1 or above $99999 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
return 1;
}
new time = strval(tmp);
if(time < 1 || time > 20) { SendClientMessage(playerid, COLOR_GREY, "   Jail Time Minutes can't be below 1 or above 20 (Take the person to prison then) !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
return 1;
}
new bail = strval(tmp);
if(bail < 0 || bail > 1) { SendClientMessage(playerid, COLOR_GREY, "   Jail Bailing can't be below 0 or above 1 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /arrest [price] [time (minutes)] [bail (0=no 1=yes)] [bailprice]");
return 1;
}
new bailprice = strval(tmp);
if(bailprice < 0 || bailprice > 3000000) { SendClientMessage(playerid, COLOR_GREY, "   Jail Bailing can't be below $0 or above $3000000 !"); return 1; }
new suspect = GetClosestPlayer(playerid);
if(IsPlayerConnected(suspect))
{
if(GetDistanceBetweenPlayers(playerid,suspect) < 5)
{
GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(WantedLevel[suspect] < 1)
{
    SendClientMessage(playerid, COLOR_GREY, "   Player must be at least Wanted Level 1 !");
    return 1;
}
format(string, sizeof(string), "* You arrested %s !", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GivePlayerMoney(suspect, -moneys);
format(string, sizeof(string), "arrested by %s ~n~    for $%d", sendername, moneys);
GameTextForPlayer(suspect, string, 5000, 5);
ResetPlayerWeapons(suspect);
if(PlayerInfo[playerid][pMember]==1||PlayerInfo[playerid][pLeader]==1)
{
format(string, sizeof(string), "<< Officer %s arrested suspect %s >>", sendername, giveplayer);
OOCNews(COLOR_LIGHTRED, string);
}
else if(PlayerInfo[playerid][pMember]==2||PlayerInfo[playerid][pLeader]==2)
{
format(string, sizeof(string), "<< FBI Agent %s arrested suspect %s >>", sendername, giveplayer);
OOCNews(COLOR_LIGHTRED, string);
}
else if(PlayerInfo[playerid][pMember]==3||PlayerInfo[playerid][pLeader]==3)
{
format(string, sizeof(string), "<< Soldier %s arrested suspect %s >>", sendername, giveplayer);
OOCNews(COLOR_LIGHTRED, string);
}
SetPlayerInterior(suspect, 6);
SetPlayerPos(suspect,264.6288,77.5742,1001.0391);
PlayerInfo[suspect][pJailTime] = time * 60;
vrijemeza = SetTimer("vrijemez",1000,true);
if(bail == 1)
{
JailPrice[suspect] = bailprice;
format(string, sizeof(string), "You are jailed for %d seconds.   Bail: $%d", PlayerInfo[suspect][pJailTime], JailPrice[suspect]);
SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
}
else
{
    JailPrice[suspect] = 0;
format(string, sizeof(string), "You are jailed for %d seconds.   Bail: Unable", PlayerInfo[suspect][pJailTime]);
SendClientMessage(suspect, COLOR_LIGHTBLUE, string);
}
PlayerInfo[suspect][pJailed] = 1;
        PlayerInfo[suspect][pArrested] += 1;
SetPlayerFree(suspect,playerid, "Got Arrested");
WantedPoints[suspect] = 0;
WantedLevel[suspect] = 0;
WantLawyer[suspect] = 1;
}//distance
}//not connected
else
{
    SendClientMessage(playerid, COLOR_GREY, "   No-one close enough to arrest.");
    return 1;
}
}
else
{
    SendClientMessage(playerid, COLOR_GREY, "   You are not a Cop / FBI / National Guard !");
    return 1;
}
}//not connected
return 1;
}



Ovo stavi na kraj scripte

public vrijemez()
{
    new string[50];
for(new i = 0; i < MAX_PLAYERS; i++)
{
    if(IsPlayerConnected(i))
    {
            format(string, sizeof(string), "~n~ ~g~Ostalo vrijeme: ~r~%d ~g~sec",PlayerInfo[i][pJailTime]-10);
        GameTextForPlayer(i, string, 999999, 0);
    }
}
}


Zatim stisni CTRL + F i upisi ovo u trazilicu else if(PlayerInfo[i][pJailed] == 2)

Ispod te funkcije zalijepi ovo
GameTextForPlayer(i, " ",1,6);
KillTimer(vrijemeza);

Poslednja Izmena: Septembar 19, 2011, 09:49:17 PRE PODNE od Charly