super simple question ;)
#1

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
Reply
#2

In the callback or on top
pawn Код:
new str[128];
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
Reply
#3

Wat Seven said, and I have a question to you:
Did/Are you script(ing) in PHP? xD
Reply
#4

No i don't, i am learning it :P
Reply
#5

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?
Reply
#6

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?
Reply
#7

Use the str

pawn Код:
format(str, sizeof(str), "SAWN OFF: %d/1000",ExpPoints[playerid]);
Edit it to your own
Reply
#8

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?
Reply
#9

Try this : (Not Tested)

pawn Код:
new pistolskill[MAX_PLAYERS];
if(!strcmp("/ws1", cmdtext, true))
{
SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 100);
pistolskill[playerid] = 100;
}
Reply
#10

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 on‌e = to many... ty
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)