[Pomoc] Prison

Započeo MicroSD_, Mart 13, 2011, 14:20:25 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: Moja
Detaljan opis problema: Kako da napravim komandu /prison, ali kada stavim igraca u areu da pise razlog.. Pokusavao sam svasta i trazio po trazilici ali opet nista. I kako da to drugi igraci vide
Dio skripte:  if(strcmp(cmd, "/prison",true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        if(PlayerInfo[playerid][pAdmin] < 2 )
        {
            SendClientMessage(playerid, COLOR_GREY, "   Niste ovlasteni !");
            return 1;
        }
        tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "Koristi: /prison [ID/Ime_Prezime][razlog]");
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), "Zatvorio si %s(ID: %d) u Area51, Razlog: %d ", giveplayer, playerid);
SendClientMessage(playerid, COLOR_IVORY, string);
format(string, sizeof(string), "Admin: %s je stavio u Area51 igraca %s, Razlog: %d !", sendername, giveplayer);
SendClientMessage(giveplayerid, COLOR_VERYRED, string);
GameTextForPlayer(giveplayerid, "~p~Dobrodosli u ~w~AREU 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
        }
}
else
{
    SendClientMessage(playerid, COLOR_RED, "igrac je offline");
    return 1;
}
    }
    return 1;
}

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


if(strcmp(cmd, "/prison",true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        if(PlayerInfo[playerid][pAdmin] < 2 )
        {
            SendClientMessage(playerid, COLOR_GREY, "   Niste ovlasteni !");
            return 1;
        }
        tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "Koristi: /prison [ID/Ime_Prezime][razlog]");
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), "Zatvorio si %s(ID: %d) u Area51, Razlog: %d ", giveplayer, playerid);
SendClientMessage(playerid, COLOR_IVORY, string);
format(string, sizeof(string), "Admin: %s je stavio u Area51 igraca %s, Razlog: %d !", sendername, giveplayer);
SendClientMessageToAll(giveplayerid, COLOR_VERYRED, string);
GameTextForPlayer(giveplayerid, "~p~Dobrodosli u ~w~AREU 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
        }
}
else
{
    SendClientMessage(playerid, COLOR_RED, "igrac je offline");
    return 1;
}
    }
    return 1;
}


Pa stavio si SendClientMessage da posalje adminu poruku :
Admin: %s je stavio u Area51 igraca %s, Razlog: %d

a trebo si stavit SendClientMessageToAll da posalje svima tu poruku.

I skirpta nije tvoja jer mi mirise na Ravens al nmvz.
Poslednja Izmena: Mart 13, 2011, 14:48:36 POSLE PODNE od Luciano Verdi



C:\DOCUME~1\komp\Desktop\CroSvera\GAMEMO~1\CS.pwn(19368) : error 035: argument type mismatch (argument 2)

to je error, a evo ti taj red
SendClientMessageToAll(giveplayerid, COLOR_VERYRED, string);

Taj error znaci da si krivo koristio parametar u funkciji, u ovom slucaju 2 parametar ili COLOR_VERYRED.
Probaj umjesto COLOR_VERYRED staviti kod od boje.




AAA

SendClientMessageToAll(COLOR_VERYRED, string);
Poslednja Izmena: Mart 13, 2011, 15:11:09 POSLE PODNE od Luciano Verdi