SA-MP Forums Archive
why this not work??? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: why this not work??? (/showthread.php?tid=148826)



why this not work??? - iJumbo - 19.05.2010

Код:
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);
}



Re: why this not work??? - NewTorran - 19.05.2010

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

Your checking for a playerid/partofname when you shouldnt be


Re: why this not work??? - iJumbo - 19.05.2010

and how for a number?


Re: why this not work??? - DaneAMattie - 19.05.2010

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;
	}



Re: why this not work??? - NewTorran - 19.05.2010

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


Re: why this not work??? - iJumbo - 19.05.2010

no dont work


Re: why this not work??? - NewTorran - 19.05.2010

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


Re: why this not work??? - DaneAMattie - 19.05.2010

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


Re: why this not work??? - iJumbo - 19.05.2010

thx work fine D


Re: why this not work??? - NewTorran - 19.05.2010

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