[Pomoc] /prison

Započeo ...Nikola..., Januar 09, 2012, 18:07:00 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: Classic Life Edit
Detaljan opis problema: Kako da napravim kod prison /prison id igraca razlog vreme
Dio skripte:
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));
GetPlayerName(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;
}

Neke slike/video za lakse dobivanje pomoci(neobavezno): /

   COMMAND:prison(playerid, params[])
{
new id, razlog[200], vrijemes, string[200];
new sendername[MAX_PLAYER_NAME];
new giveplayer[MAX_PLAYER_NAME];
if (sscanf(params, "uds[128]", id, vrijemes, razlog))
{
if(PlayerInfo[playerid][pAdmin] >= 2)
{
SCM(playerid, COLOR_GRAD2, "{168BFF}INFO: {959561} /prison {959561}[ID/DioImena] [Vrijeme] [Razlog]");
return 1;
}
}
else
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
   if(IsPlayerConnected(id))
{
GetPlayerName(id, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
WantedPoints[giveplayerid] = 0;
WantedLevel[giveplayerid] = 0;
PlayerInfo[giveplayerid][pJailed] = 2;
PlayerInfo[giveplayerid][pJailTime] = 3600;
SetPlayerPos(id, X,Y,Z);
SetPlayerInterior(id, 0);
format(string,sizeof(string), "{FF0000}Zatvoren si u zatvor! | Vrijeme: {FFFF80}%d minuta| {FF0000}Admin:{FFFF80} %s | {FF0000}Razlog: {FFFF80}%s", vrijemes, sendername, razlog);
TextDrawShowForPlayer(id, pritvorvrijeme[playerid]);
SCM(id, 0xFF4141FF, string);
format(string,sizeof(string), "Zatvorio si {FF9797}%s {FF4141}u Zatvor! | Vrijeme: {FF9797}%d minuta {FF4141}| Razlog: {FF9797}%s", giveplayer, vrijemes, razlog);
SCM(playerid, 0xFF4141FF, string);
}
else
{
SCM(playerid, GREY, "Taj igrac nije online!");
}
}
else
{
SCM(playerid, GREY, "Nisi ovlasten!");
}
}
return 1;
}

javi jel valja...

@Fico62 - ne piši gluposti.

1. Zašto varijabla razlog ima array 200 , a u sscanfu 128 - neće raditi zašto? Zato što SA:MP podržava 128 slova u jednom redu. String 200 - max. 128 , zašto? Zato što SA:MP podržava 128 slova u jednom redu (uključujući i razmak)

2. Vidiš da on ne radi sa ZCMD i SSCANF.
"I'm a loser and a user so I don't need no accuser" - Billie Joe Armstrong