SA-MP Forums Archive
/skydive choice - 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)
+--- Thread: /skydive choice (/showthread.php?tid=455472)



/skydive choice - cray1100 - 01.08.2013

I have a cmd that allows players to do /skydive, and it adds 1000 meters to their current location... Is it possible to make them be able to choose the meters? such as...

/skydive [amount of meters they want to go]

Is it possible? and can you show me?

Код:
if(!strcmp("/chuter",cmdtext,true))
  	{
                new Float:pPos[3];
	  	GivePlayerWeapon(playerid,46,1);
	  	GetPlayerPos(playerid,pPos[0],pPos[1],pPos[2]);
		SetPlayerPos(playerid,pPos[0],pPos[1],pPos[2]+1000);
  		return 1;
	}



Re: /skydive choice - Amel_PAtomAXx - 02.08.2013

pawn Код:
if(strcmp( cmd, "/skydive", true ) == 0 )
{
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) {
        SendClientMessage(playerid, COLOR_GREY, "USAGE: /skydive [metters]");
        return 1;
    }
    new metters;
    metters = strval(tmp);
    new Float:X, Float:Y, Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    SetPlayerPos(playerid,X, Y, metters);
    GivePlayerWeapon(playerid,46,1);
    return 1;
}



Re: /skydive choice - cray1100 - 02.08.2013

Quote:
Originally Posted by Amel_PAtomAXx
Посмотреть сообщение
pawn Код:
if(strcmp( cmd, "/skydive", true ) == 0 )
{
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) {
        SendClientMessage(playerid, COLOR_GREY, "USAGE: /skydive [metters]");
        return 1;
    }
    new input;
    input = strval(tmp);
    new Float:X, Float:Y, Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    SetPlayerPos(playerid,X, Y, input);
    GivePlayerWeapon(playerid,46,1);
    return 1;
}
That failed to work...


Re: /skydive choice - Amel_PAtomAXx - 02.08.2013

Quote:
Originally Posted by cray1100
Посмотреть сообщение
That failed to work...
I tried also, and It works fine for me.
Did you compiled successfully?


Re: /skydive choice - Jefff - 02.08.2013

pawn Код:
if(!strcmp(cmdtext, "/chuter", true, 7))
{
    if(!cmdtext[7]) // return usage: /chuter [amount of meters they want to go]
    new Float:zPos = floatstr(cmdtext[8]);
    if(!zPos) // return error: must be more than 0
    new Float:pPos[3];
    GivePlayerWeapon(playerid,46,1);
    GetPlayerPos(playerid,pPos[0],pPos[1],pPos[2]);
    SetPlayerPos(playerid,pPos[0],pPos[1],pPos[2]+zPos);
    return 1;
}



Re: /skydive choice - cray1100 - 03.08.2013

Quote:
Originally Posted by Amel_PAtomAXx
Посмотреть сообщение
I tried also, and It works fine for me.
Did you compiled successfully?
Yes, also it loaded fine, but ingame... When i use the /skydive command, it does nothing, it doesnt say the command isnt known... But it just dont do anything... all my other commands use the same includes actually, but it didnt qork