Unreachable Code
#1

Код:
    return SendClientMessageToAll( 0xB2FF7FFF, string );
    return GameTextForPlayer(playerid,"+4000$, +2 Score",2000,3);
//warning 225: unreachable code

Hi, Know everyone an Answer?
Reply
#2

Try this:
pawn Код:
return SendClientMessageToAll( 0xB2FF7FFF, string ), GameTextForPlayer( playerid, "+4000$, +2 Score", 2000, 3 );
Reply
#3

It works, but the GameText dont appear on the Screen. Where is the Problem?
Reply
#4

Try this then:
pawn Код:
SendClientMessageToAll( 0xB2FF7FFF, string );
GameTextForPlayer(playerid,"+4000$, +2 Score",2000,3);
return 1;
It should work now
Reply
#5

The GameText work still not, i dont know why, no Error come.
Reply
#6

pawn Код:
SendClientMessageToAll( 0xB2FF7FFF, string );
new string[24];
format(string, sizeof(string), "+4000$, +2 Score");
GameTextForPlayer(playerid,string,3000,3);
return 1;
Reply
#7

Thx, will that work so too?

Код:
    SendClientMessageToAll( 0xB2FF7FFF, string );
    
    new str[24];
    format(str, sizeof(str), "+4000$, +2 Score");
    GameTextForPlayer(killerid,str,3000,3);
    
    new st[24];
    format(st, sizeof(st), "You died -3000$!");
    GameTextForPlayer(playerid,st,3000,3);
    return 1;
    }
Reply
#8

Quote:
Originally Posted by Blackazur
Посмотреть сообщение
Thx, will that work so too?

Код:
    SendClientMessageToAll( 0xB2FF7FFF, string );
    
    new str[24];
    format(str, sizeof(str), "+4000$, +2 Score");
    GameTextForPlayer(killerid,str,3000,3);
    
    new st[24];
    format(st, sizeof(st), "You died -3000$!");
    GameTextForPlayer(playerid,st,3000,3);
    return 1;
    }
It should work as well.
Reply
#9

I tested it it appear not on the Screen, the Public is "OnPlayerDeath", is the Problem that it is an Filterscript, should i add it in my main Gamemode?
Reply
#10

Quote:
Originally Posted by Blackazur
Посмотреть сообщение
I tested it it appear not on the Screen, the Public is "OnPlayerDeath", is the Problem that it is an Filterscript, should i add it in my main Gamemode?
For it to appear, you must have the killer and you yourself. Test it with someone, not by yourself alone.

Just for an example:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    SendDeathMessage(killerid, playerid, reason); // Shows the kill in the killfeed/deathlog/death window
 
    if(killerid != INVALID_PLAYER_ID) // Valid killer, give cash+score
    {
        new str[24];
        format(str, sizeof(str), "+4000$, +2 Score");
        GameTextForPlayer(killerid,str,3000,3);
 
        GivePlayerMoney(killerid, +4000);
        GivePlayerScore(killerid, +2);
    }
 
    // Outside the check, handle stuff for playerid
    // if killerid was INVALID_PLAYER_ID the player killed themselves (i.e. falling)
    new st[24];
        format(st, sizeof(st), "You died -3000$!");
        GameTextForPlayer(playerid,st,3000,3);
    GivePlayerMoney(playerid, -3000);
   
   
   
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)