SA-MP Forums Archive
jet pls help - 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: jet pls help (/showthread.php?tid=341064)



jet pls help - Edin Black - 09.05.2012

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


Re: jet pls help - Slix_ - 09.05.2012

pawn Код:
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(giveplayerid, SPECIAL_ACTION_USEJETPACK); // Change playerid to giveplayerid
                        return 1;
                    }
                }//not connected
            }
            else
            {
                format(string, sizeof(string), "   %d nije aktivan igrac.", giveplayerid);
                SendClientMessage(playerid, COLOR_GRAD1, string);
            }
        }
        return 1;
    }



Re: jet pls help - john_jenkins - 09.05.2012

man put that on pwano:
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;


Re: jet pls help - TheDominator - 09.05.2012

Use the [ PAWN ] tags, without the spaces. And when you've finished the code use [ /PAWN ]