why this not work???
#1

Код:
dcmd_music(playerid,params[])
{
	new soundid;
	if(sscanf(params, "ud", soundid)) return SendClientMessage(playerid, RED, "/music [music id]");
	return PlayerPlaySound(playerid,soundid,0.0,0.0,0.0);
}
Reply
#2

if(sscanf(params, "ud", soundid))

Your checking for a playerid/partofname when you shouldnt be
Reply
#3

and how for a number?
Reply
#4

Quote:
Originally Posted by [ZDM
jumbo ]
Код:
dcmd_music(playerid,params[])
{
	new soundid;
	if(sscanf(params, "ud", soundid)) return SendClientMessage(playerid, RED, "/music [music id]");
	return PlayerPlaySound(playerid,soundid,0.0,0.0,0.0);
}
How about:
Код:
if (strcmp("/music", cmdtext, true, 5) == 0)
	{
		new soundid;
	    if(sscanf(params, "ud", soundid)) 
        {
        SendClientMessage(playerid, RED, "/music [music id]");
        }
        else
        {
	    PlayerPlaySound(playerid,soundid,0.0,0.0,0.0);
        }
		return 1;
	}
Reply
#5

Wrong and wrong xd

pawn Код:
dcmd_music(playerid,params[])
{
    new soundid;
    if(sscanf(params, "i", soundid)) return SendClientMessage(playerid, RED, "/music [music id]");
    return PlayerPlaySound(playerid,soundid,0.0,0.0,0.0);
}
That should do it
Reply
#6

no dont work
Reply
#7

pawn Код:
dcmd_music(playerid,params[])
{
new soundid;
if(sscanf(params, "d", soundid)) return SendClientMessage(playerid, RED, "/music [music id]");
PlayerPlaySound(playerid,soundid,0.0,0.0,0.0);
return 1;
}
Try that
Reply
#8

DOH!

look it sais: PlayerPlaySound(playerid,soundid,0.0,0.0,0.0);
X = 0
Y = 0
Z = 0

u need to use the player pos right?
so:
new pX;
new pY;
new pZ;
GetPlayerPos(playerid,pX,pY,pZ);
as first on the command
Reply
#9

thx work fine D
Reply
#10

Quote:
Originally Posted by DaneAMattie
DOH!

look it sais: PlayerPlaySound(playerid,soundid,0.0,0.0,0.0);
X = 0
Y = 0
Z = 0

u need to use the player pos right?
so:
new pX;
new pY;
new pZ;
GetPlayerPos(playerid,pX,pY,pZ);
as first on the command
The 0, 0, 0 Are offsets not the actual position
Quote:
Originally Posted by [ZDM
jumbo ]
thx work fine D
Which one? Mine or his
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)