Jump to content
  • 0

problema script/comanda ce o fi


Myhaytza1

Question

18 answers to this question

Recommended Posts

[pawn]public OnPlayerDeath ( playerid , killerid , reason )

{

    new

        string [ 64 ]

    ;

    if ( killerid != INVALID_PLAYER_ID )

    {

        format ( string , sizeof ( string ) , "Ai fost omorat de %s." , killerid ) ;

    }

    SendClientMessage ( playerid , -1 , string ) ;

    return ( true ) ;

}[/pawn]

Link to comment
Share on other sites

[pawn]D:\samp 0.3xa\pawno\include\SpikeStrip.inc(27) : warning 219: local variable "lights" shadows a variable at a preceding level

D:\samp 0.3xa\gamemodes\gf.pwn(5709) : error 029: invalid expression, assumed zero

D:\samp 0.3xa\gamemodes\gf.pwn(5710) : error 001: expected token: ";", but found "{"

D:\samp 0.3xa\gamemodes\gf.pwn(5712) : warning 219: local variable "string" shadows a variable at a preceding level

D:\samp 0.3xa\gamemodes\gf.pwn(5722) : warning 225: unreachable code

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

2 Errors.

[/pawn]

P.s: warning de la linia 27 e dinainte restu mi le da acum

Link to comment
Share on other sites

public OnPlayerDeath ( playerid , killerid , reason )

{

    new

        localString [ 64 ]

    ;

    if ( killerid != INVALID_PLAYER_ID )

    {

        format ( localString , sizeof ( localString ) , "Ai fost omorat de %s." , killerid ) ;

    }

    SendClientMessage ( playerid , -1 , localString ) ;

    return ( true ) ;

}

7bdea99b11.png

rimmon curv.

Link to comment
Share on other sites

Am rezolvat,insa as mai dori sa stiu ceva

Cum pot sa fac la comanda /mission cand o iau sa imi faca numele rosu?

[pawn] if(strcmp(cmd,"/mission",true)==0)

    {

        if(IsPlayerConnected(playerid))

        {

          if(PlayerToPoint(3.0,playerid,1381.0413,-1088.8511,27.3906) || PlayerToPoint(3.0,playerid,-1963.6067,437.5748,35.1719))

          {

if(MissionPlayable == 0)

{

    SendClientMessage(playerid, COLOR_GREY, "  No Mission has been Activated !");

    return 1;

}

if(PlayerInfo[playerid][pMissionNr] == MissionPlayable)

{

    SendClientMessage(playerid, COLOR_GREY, "  You've already completed the Active Mission !");

    return 1;

}

if(CP[playerid] == 1)

{

    SendClientMessage(playerid, COLOR_GREY, "  You can`t take the mission, drop the car at the crane !");

    return 1;

}

if(IsCollectingRubbish[playerid] == 1)

{

    SendClientMessage(playerid, COLOR_GREY, "  You can`t take the mission, Collect the Rubbish!");

    return 1;

}

RingTone[playerid] = 20;

PlayerOnMission[playerid] = PlayMission[kNumber];

MissionCheckpoint[playerid] = 1;

format(string, sizeof(string), "~w~Mission started: ~n~~r~%s", PlayMission[kTitle]);

GameTextForPlayer(playerid, string, 5000, 3);

format(string, sizeof(string), "%s", PlayMission[kText1]);

SendClientMessage(playerid, COLOR_YELLOW2, string);

format(string, sizeof(string), "%s", PlayMission[kText2]);

SendClientMessage(playerid, COLOR_YELLOW2, string);

format(string, sizeof(string), "%s", PlayMission[kText3]);

SendClientMessage(playerid, COLOR_YELLOW2, string);

if(PlayMission[kToggle] == 1)

{

SetPlayerCheckpoint(playerid, PlayMission[kCP1][0], PlayMission[kCP1][1], PlayMission[kCP1][2], 8);

}

  }

  else

          {

              SendClientMessage(playerid, COLOR_GREY, "  You are not at the Bill Board !");

          }

        }

        return 1;

    }[/pawn]

Aceasta este comanda /mission mersi.

P.S: Am o problema la comanda de mai sus 2hoabtl.jpg uitati poza si va dati seama scrie Ai fost omorat de A...

Link to comment
Share on other sites

Ok ai putea unde sa o pun,adica am intrat GM am cautat lina OnPlayer Death si am adaugat acolo... :|

Pai, tu ai ceva de genu' asta in script:

[pawn]public OnPlayerDeath ( playerid , killerid , reason )

{

    // ...

    // ...

    // ...

    // ...

    // ...

    // ...

    // ...

    return ( true ) ;

}[/pawn]

Iar codul este acesta:

[pawn]    new

        string [ 64 ]

    ;

    if ( killerid != INVALID_PLAYER_ID )

    {

        format ( string , sizeof ( string ) , "Ai fost omorat de %s." , killerid ) ;

    }

    SendClientMessage ( playerid , -1 , string ) ;[/pawn]

Iar atunci cand le impreunezi, va arata cam asa:

[pawn]public OnPlayerDeath ( playerid , killerid , reason )

{

    new

        string [ 64 ]

    ;

    if ( killerid != INVALID_PLAYER_ID )

    {

        format ( string , sizeof ( string ) , "Ai fost omorat de %s." , killerid ) ;

    }

    SendClientMessage ( playerid , -1 , string ) ;

    // ...

    // ...

    // ...

    // ...

    // ...

    // ...

    // ...

    return ( true ) ;

}[/pawn]

EDIT: Vad ca ai rezolvat cu asta.

Am rezolvat,insa as mai dori sa stiu ceva

Cum pot sa fac la comanda /mission cand o iau sa imi faca numele rosu?

[pawn] if(strcmp(cmd,"/mission",true)==0)

    {

        if(IsPlayerConnected(playerid))

        {

          if(PlayerToPoint(3.0,playerid,1381.0413,-1088.8511,27.3906) || PlayerToPoint(3.0,playerid,-1963.6067,437.5748,35.1719))

          {

if(MissionPlayable == 0)

{

    SendClientMessage(playerid, COLOR_GREY, "  No Mission has been Activated !");

    return 1;

}

if(PlayerInfo[playerid][pMissionNr] == MissionPlayable)

{

    SendClientMessage(playerid, COLOR_GREY, "  You've already completed the Active Mission !");

    return 1;

}

if(CP[playerid] == 1)

{

    SendClientMessage(playerid, COLOR_GREY, "  You can`t take the mission, drop the car at the crane !");

    return 1;

}

if(IsCollectingRubbish[playerid] == 1)

{

    SendClientMessage(playerid, COLOR_GREY, "  You can`t take the mission, Collect the Rubbish!");

    return 1;

}

RingTone[playerid] = 20;

PlayerOnMission[playerid] = PlayMission[kNumber];

MissionCheckpoint[playerid] = 1;

format(string, sizeof(string), "~w~Mission started: ~n~~r~%s", PlayMission[kTitle]);

GameTextForPlayer(playerid, string, 5000, 3);

format(string, sizeof(string), "%s", PlayMission[kText1]);

SendClientMessage(playerid, COLOR_YELLOW2, string);

format(string, sizeof(string), "%s", PlayMission[kText2]);

SendClientMessage(playerid, COLOR_YELLOW2, string);

format(string, sizeof(string), "%s", PlayMission[kText3]);

SendClientMessage(playerid, COLOR_YELLOW2, string);

if(PlayMission[kToggle] == 1)

{

SetPlayerCheckpoint(playerid, PlayMission[kCP1][0], PlayMission[kCP1][1], PlayMission[kCP1][2], 8);

}

  }

  else

          {

              SendClientMessage(playerid, COLOR_GREY, "  You are not at the Bill Board !");

          }

        }

        return 1;

    }[/pawn]

Aceasta este comanda /mission mersi.

Ca sa faci numele unui jucator rosu, incearca asta:

[pawn] if(strcmp(cmd,"/mission",true)==0)

    {

        if(IsPlayerConnected(playerid))

        {

          if(PlayerToPoint(3.0,playerid,1381.0413,-1088.8511,27.3906) || PlayerToPoint(3.0,playerid,-1963.6067,437.5748,35.1719))

          {

if(MissionPlayable == 0)

{

    SendClientMessage(playerid, COLOR_GREY, "  No Mission has been Activated !");

    return 1;

}

if(PlayerInfo[playerid][pMissionNr] == MissionPlayable)

{

    SendClientMessage(playerid, COLOR_GREY, "  You've already completed the Active Mission !");

    return 1;

}

if(CP[playerid] == 1)

{

    SendClientMessage(playerid, COLOR_GREY, "  You can`t take the mission, drop the car at the crane !");

    return 1;

}

if(IsCollectingRubbish[playerid] == 1)

{

    SendClientMessage(playerid, COLOR_GREY, "  You can`t take the mission, Collect the Rubbish!");

    return 1;

}

RingTone[playerid] = 20;

PlayerOnMission[playerid] = PlayMission[kNumber];

MissionCheckpoint[playerid] = 1;

format(string, sizeof(string), "~w~Mission started: ~n~~r~%s", PlayMission[kTitle]);

GameTextForPlayer(playerid, string, 5000, 3);

                        SetPlayerColor(playerid, 0xFF0000FF);

format(string, sizeof(string), "%s", PlayMission[kText1]);

SendClientMessage(playerid, COLOR_YELLOW2, string);

format(string, sizeof(string), "%s", PlayMission[kText2]);

SendClientMessage(playerid, COLOR_YELLOW2, string);

format(string, sizeof(string), "%s", PlayMission[kText3]);

SendClientMessage(playerid, COLOR_YELLOW2, string);

if(PlayMission[kToggle] == 1)

{

SetPlayerCheckpoint(playerid, PlayMission[kCP1][0], PlayMission[kCP1][1], PlayMission[kCP1][2], 8);

}

  }

  else

          {

              SendClientMessage(playerid, COLOR_GREY, "  You are not at the Bill Board !");

          }

        }

        return 1;

    }[/pawn]

Link to comment
Share on other sites

Da am reusit cu aia dar acum  2hoabtl.jpg arata asa cand ma omoara cineva:|

Incearca asta:

[pawn]    new

        string    [ 64 ]

        kname      [ 64 ]

    ;

    GetPlayerName ( killerid , kname , sizeof ( kname ) ) ;

    format ( string , sizeof ( string ) , "Ai fost omorat de %s." , kname ) ;

    SendClientMessage ( playerid , -1 , string ) ;[/pawn]

Inlocuieste codul pe care il ai (care trimite jucatorului datele) cu ce ti-am dat mai sus.Scuze, am facut eu o greseala.

Link to comment
Share on other sites

Killerid reprezinta DOAR id-ul celui care a l-a omorat , daca v-a pune %d, va aparea IDul inamicului.

Pune functia de aflare a numelui, nu stiu cum e la tine acolo,

new killername[64];

GetPlayerName(killerid, killername,sizeof(killername));

Iar la comanda pune in loc de killerid(de la sfasit), pune killername.

* %d - DOAR pentru cifre

* %s - DOAR pentru litere si cifre, folosit in special pentru nume de playeri/factiuni etc.

Link to comment
Share on other sites

Killerid reprezinta DOAR id-ul celui care a l-a omorat , daca v-a pune %d, va aparea IDul inamicului.

Pune functia de aflare a numelui, nu stiu cum e la tine acolo,

new killername[64];

GetPlayerName(killerid, killername,sizeof(killername));

Iar la comanda pune in loc de killerid(de la sfasit), pune killername.

* %d - DOAR pentru cifre

* %s - DOAR pentru litere si cifre, folosit in special pentru nume de playeri/factiuni etc.

Stiam eu ca lipseste ceva dar nu stiam ce.Multumesc ca mi-ai spus de greseala (chiar uitasem sa iau numele jucatorului care ucide).Am corectat postul de mai sus.

Link to comment
Share on other sites

[pawn]D:\samp 0.3xa\pawno\include\SpikeStrip.inc(27) : warning 219: local variable "lights" shadows a variable at a preceding level

D:\samp 0.3xa\gamemodes\gf.pwn(5712) : warning 219: local variable "string" shadows a variable at a preceding level

D:\samp 0.3xa\gamemodes\gf.pwn(5713) : error 001: expected token: ";", but found "-identifier-"

D:\samp 0.3xa\gamemodes\gf.pwn(5713) : error 017: undefined symbol "kname"

D:\samp 0.3xa\gamemodes\gf.pwn(5713) : warning 215: expression has no effect

D:\samp 0.3xa\gamemodes\gf.pwn(5713) : error 001: expected token: ";", but found "]"

D:\samp 0.3xa\gamemodes\gf.pwn(5713) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

4 Errors.

[/pawn]

:|

Link to comment
Share on other sites

[pawn]D:\samp 0.3xa\pawno\include\SpikeStrip.inc(27) : warning 219: local variable "lights" shadows a variable at a preceding level

D:\samp 0.3xa\gamemodes\gf.pwn(5712) : warning 219: local variable "string" shadows a variable at a preceding level

D:\samp 0.3xa\gamemodes\gf.pwn(5713) : error 001: expected token: ";", but found "-identifier-"

D:\samp 0.3xa\gamemodes\gf.pwn(5713) : error 017: undefined symbol "kname"

D:\samp 0.3xa\gamemodes\gf.pwn(5713) : warning 215: expression has no effect

D:\samp 0.3xa\gamemodes\gf.pwn(5713) : error 001: expected token: ";", but found "]"

D:\samp 0.3xa\gamemodes\gf.pwn(5713) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

4 Errors.

[/pawn]

:|

[pawn]    new

        string    [ 64 ] ,

        kname      [ 64 ]

    ;

    GetPlayerName ( killerid , kname , sizeof ( kname ) ) ;

    format ( string , sizeof ( string ) , "Ai fost omorat de %s." , kname ) ;

    SendClientMessage ( playerid , -1 , string ) ;[/pawn]

Scuze, greseala mea.Am uitat sa pun o virgula 1.gif.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.