Jump to content
  • 0

problema comanda zcmd (cmd:up)


Question

Posted

Salut,baieti.

Am si eu o problema.

Cand am bagat comanda de jos.

Pe ZCMD.

Cand dau /up INTALTIMEA.

Imi zice doar UP intaltime nu ma ridica.

Asa a patit si Sweet si eu.

Daca mio puteti face (MENTIONEZ folosesc SSCANF)

Repede daca se poate.

CMD:up(playerid,params[])
{
new Float:x, Float:y, Float:z;
new height;
if(height != 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
GetVehiclePos(GetPlayerVehicleID(playerid), x, y, z);
SetVehiclePos(GetPlayerVehicleID(playerid), x, y, z + height);
}
else
{
GetPlayerPos(playerid, x, y, z);
GivePlayerWeapon(playerid, 46, 1);
SetPlayerPos(playerid, x, y, z + height);
}
}
else
{
SendClientMessage(playerid, COLOR_GREEN, "/UP {FFFFFF}|inaltime|");
}
return 1;
}

468833_437698_362328_hiphop.jpg

4 answers to this question

Recommended Posts

Posted

incearca formula de idx

new cmd[256];

new idx;

cmd = strtok(cmdtext, idx);

if(strcmp( cmd, "/up", true ) == 0 )

{

new Float:X, Float:Y, Float:Z;

new tmp[256];

tmp = strtok( cmdtext, idx );

Apoi cred ca te descurci ... o sa incerc acuma  sa o fac. Si iti spun daca mi-a iesit si ti-o dau.

Uitate mai jos >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Uite aici

iti trebuie mai intai:

[pawno code] //dami si mie prin pm cum se foloseste codul asta de pawno ca la mine nu apare daca apas la bara sus...zimi clar cum se scrie

#include "../include/gl_common.inc" //ca sa iti mearga cmd

public OnPlayerCommandText(playerid, cmdtext[])

{

new hx;                    //am puso sa fie pt inaltime :h

cmd = strtok(cmdtext, hx);

if(strcmp(cmd,"/up",true)==0)

{

new Float:X, Float:Y, Float:Z;

new tmp[256];

tmp = strtok( cmdtext, hx );

GetPlayerPos( playerid, X, Y, Z );

SetPlayerPos(playerid,X,Y,Z+strval(tmp));

return 1;

}

[/pawno code]

Am  facut-o adineauri,am si testat-o ,merge....Pui tu textu o faci lafel si pt masina cu +strval(tmp) si gata.

:wink:

Posted
CMD:up(  playerid, params[ ] )
{
	new Float:x, Float:y, Float:z;
	new height = strval( params);
	if( height == 0 ) return SendClientMessage( playerid, COLOR_RED, "USAGE: {FFFF00}/up [Height]" );

	if( IsPlayerInAnyVehicle( playerid))
	{
	GetVehiclePos( GetPlayerVehicleID( playerid), x, y, z);
	SetVehiclePos( GetPlayerVehicleID( playerid), x, y, z + height);
	}
	else
	{
	GetPlayerPos( playerid, x, y, z);
	GivePlayerWeapon( playerid, 46, 1);
	SetPlayerPos( playerid, x, y, z + height);
	}
	return 1;
}

Fara reclama in semnatura!

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.