Jetpack
#1

Hello I am a pwn beginner and i have a question

can anyone make me a command: /jetpack [ID] and he become a jetpack and he can fly.

sorry for my bad english, and i will not to trie it, because i canґt this.

In strcmp !
Reply
#2

Take a look at another command in your gamemode which has the [ID] parameter. Copy and paste that command and change around variable names so it matches the new command you're making. Then inside of the command put

pawn Код:
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
Reply
#3

pawn Код:
if(strcmp(cmdtext, "/jetpack", true))
{
    SendClientMessage(playerid, -1, "Spawned a Jetpack!");
        SetPlayerSpecialAction(playerid,2);
        return 1;
}
Reply
#4

.. Deleted

I make this.
Reply
#5

Problem -.-

Код:
if(strcmp(cmd, "/jetpack", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
      tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_DGOLD, "KORISTENJE: /jetpack [ID/DioImena]");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
			if (PlayerInfo[playerid][pAdmin] >= 4)
			{
			    if(IsPlayerConnected(giveplayerid))
			    {
			        if(giveplayerid != INVALID_PLAYER_ID)
			        {
					    SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
						return 1;
					}
				}//not connected
			}
			else
			{
				format(string, sizeof(string), "   %d nije aktivan igrac.", giveplayerid);
				SendClientMessage(playerid, COLOR_GRAD1, string);
			}
		}
		return 1;
	}
This is my command, but when i write /jetpack and a another ID i became the jetpack pls help
Reply
#6

man do that in pawno ublic OnPlayerCommandText(playerid, cmdtext[]){ if(IsPlayerAdmin(playerid)) { if(!strcmp(cmdtext, "/jetpack", true)) { SendClientMessage(playerid, -1, "Spawned a Jetpack!"); SetPlayerSpecialAction(playerid,2); return 1; } } return 0;
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)