Jump to content

Question

Posted

Salutare SA-MP.ro de doua saptamani lucrez la un GM de stunt si acum am ajuns la Callbackul OnPlayerCommandPerformed , am facut ca atunci cand scrii o comanda incorecta sa-ti spune ca nu exista..deci ati inteles voi, si nu am pus ca acest text sa apara in chat dar pe display:

[pawn]

public OnPlayerCommandPerformed( playerid, cmdtext[ ], success )

{

    if ( success == 0 )

SendInfo( playerid , "~g~Comanda ~r~%s ~g~nu exista ! Foloseste ~r~/cmds ~g~pentru a te informa ! " , 6000 , cmdtext );

    return 1;

}

[/pawn]

Am creat acest Stock SendInfo, pentru a fi mai usor:

[pawn]

stock SendInfo( playerid, info[], TIMEs = 3000)

{

    if ( P_INFO[ playerid ][ P_Info ] == 1 )

{

KillTimer( InfoTimer[ playerid ] );

TextDrawSetString( Text:Textdraw8[ playerid ], info );

InfoTimer[ playerid ] = SetTimerEx( "HideInfo", TIMEs, false, "i", playerid );

ShowTD( playerid, Textdraw8[ playerid ] );

PlayerPlaySound( playerid, 1085, 0.0,0.0,0.0 );

}

return 1;

}

[/pawn]

Si iata Textdrawul care indica pozitia unde va trebui sa fie textul, dimensiunile, etc.

[pawn]

                                                                                                                    Textdraw8[ playerid ] = TextDrawCreate(222.000000, 359.000000, " ");

TextDrawBackgroundColor(Textdraw8[ playerid ], 255);

TextDrawFont(Textdraw8[ playerid ], 1);

TextDrawLetterSize(Textdraw8[ playerid ], 0.370000, 1.199999);

TextDrawColor(Textdraw8[ playerid ], -1);

TextDrawSetOutline(Textdraw8[ playerid ], 0);

TextDrawSetProportional(Textdraw8[ playerid ], 1);

TextDrawSetShadow(Textdraw8[ playerid ], 1);

TextDrawSetSelectable(Textdraw8[ playerid ], 0);

[/pawn]

The problem is :

Atunci cand scriu comanda incorecta in CHAT nu apare nimic, apsolut !

NOTE: Textdraw8 meu se afla la callbackul OnPlayerConnect, pentru ca conetine [playerid ]

5 answers to this question

Recommended Posts

Posted

[pawn]

public OnPlayerCommandPerformed( playerid, cmdtext[ ], success )

{

    if ( success == 0 )

SendInfo( playerid , "~g~Comanda ~r~%s ~g~nu exista ! Foloseste ~r~/cmds ~g~pentru a te informa ! " , 6000 , cmdtext );

    return 1;

}[/pawn]

asta e pusa dupa ultima comanda??

sau e prima?

din cate stiu trebuie pusa ultima

de ex

pui toate comenzile apoi

[pawn]

{

    if ( success == 0 )

SendInfo( playerid , "~g~Comanda ~r~%s ~g~nu exista ! Foloseste ~r~/cmds ~g~pentru a te informa ! " , 6000 , cmdtext );

    return 1;

}[/pawn]

 

 

430x73_FFFFFF_FF9900_000000_000000.png

 
Posted

Eu nu folosesc strcmd , folosesc numai ZCMD, acolo ce am pus eu la onplayercommandperformed, e singura ce am eu in acest callback

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.