super simple question ;) -
nejc001 - 18.09.2010
How to add a variable in SendClientMessage?
I get always errors.
Код:
new ExpPoints[MAX_PLAYERS];
SendClientMessage(playerid, 0xFF9900AA,"SAWN OFF:" ExpPoints "/1000" );
So ingame should say: SAWN OFF: 250/1000
number 250 is an example
Re: super simple question ;) -
Seven. - 18.09.2010
In the callback or on top
This where you want to use it.
pawn Код:
format(str, sizeof(str), "SAWN OFF: %d/1000",ExpPoints[playerid]);
SendClientMessage(playerid,0xFF9900AA,str);
Have fun :P
Re: super simple question ;) -
Kwarde - 18.09.2010
Wat Seven said, and I have a question to you:
Did/Are you script(ing) in PHP? xD
Re: super simple question ;) -
Seven. - 18.09.2010
No i don't, i am learning it :P
Re: super simple question ;) -
Kwarde - 18.09.2010
Ok

- Because in PHP you have to give strings like this: <?php echo "This is the ".$something."th time you're here"; ?>
But whatever,
your question has been answered?
Re: super simple question ;) -
nejc001 - 18.09.2010
yea, well in that case... but i failed -.-
Its like more complicated. :/
i have this code now, i hope thats correct,
Код:
{
public OnPlayerDeath(playerid, killerid, reason)
{
if(GetPlayerWeapon(killerid) == 22)
ExpPoints[killerid]+=20;
SendClientMessage(playerid, 0xFFFF00AA,"You killed somebody. Your experience with Pistol 9mm has increased.");
if(ExpPoints[playerid] == 100)
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 100);
}
return 1;
}
well now i need that "WEAPONSKILL_PISTOL" is in "SendClientMessage" that i posted in first post at "ExpPoints" place. First i just replaced "WEAPONSKILL_PISTOL" with "ExpPoints" but i get some errors.
How to do that?
Re: super simple question ;) -
Seven. - 18.09.2010
Use the str
pawn Код:
format(str, sizeof(str), "SAWN OFF: %d/1000",ExpPoints[playerid]);
Edit it to your own
Re: super simple question ;) -
nejc001 - 18.09.2010
i dont have a clue what do you mean -.-'
but whatever i fixed that, almost.
Код:
new pistolskill[MAX_PLAYERS];
if(!strcmp("/ws1", cmdtext,true))
{
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 100);
pistolskill == 100; // error
}
how to make that variable "pistolskill" is 100?
Re: super simple question ;) -
Basicz - 18.09.2010
Try this : (Not Tested)
pawn Код:
new pistolskill[MAX_PLAYERS];
if(!strcmp("/ws1", cmdtext, true))
{
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 100);
pistolskill[playerid] = 100;
}
Re: super simple question ;) -
nejc001 - 18.09.2010
Quote:
Originally Posted by Basicz
Try this : (Not Tested)
pawn Код:
new pistolskill[MAX_PLAYERS]; if(!strcmp("/ws1", cmdtext, true)) { SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 100); pistolskill[playerid] = 100; }
|
i always forget the [playerid] thing and one = to many... ty