SA-MP Forums Archive
just small 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: just small help (/showthread.php?tid=490187)



just small help - AIMigboboy - 25.01.2014

When player uses this cmd he should get a white hockey mask and should be able to use it every 5mins

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/SH", cmdtext, true, 10) == 0)
	{
 		GivePlayerWeapon(playerid, 30, 320);
    	GivePlayerWeapon(playerid, 29, 350);
    	GivePlayerWeapon(playerid, 34, 10);
   	 	SetPlayerSkin(playerid, 122);
   	 	
		return 1;
	}
	return 0;
}



Re: just small help - AIMigboboy - 25.01.2014

bumb


Re: just small help - Kyance - 25.01.2014

Quote:
Originally Posted by AIMigboboy
Посмотреть сообщение
When player uses this cmd he should get a white hockey mask and should be able to use it every 5mins

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/SH", cmdtext, true, 10) == 0)
	{
 		GivePlayerWeapon(playerid, 30, 320);
    	GivePlayerWeapon(playerid, 29, 350);
    	GivePlayerWeapon(playerid, 34, 10);
   	 	SetPlayerSkin(playerid, 122);
   	 	
		return 1;
	}
	return 0;
}
pawn Код:
//Above code, local
new
    bool: CanUseSH[ MAX_PLAYERS char ]
;



//OnPlayerConnect
CanUseSH{ playerid } = false;
SetTimerEx("CanUseSHH", 300000, false, "i", playerid);



//Timer
forward CanUseSHH(playerid);
public CanUseSHH(playerid)
{
    CanUseSH{ playerid } = true;
    SendClientMessage(playerid, -1, "You can use /sh again!");
    return 1;
}



//command:



public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/SH", cmdtext, true, 10) == 0)
    {
            if(!CanUseSH{ playerid } )
            {
                SendClientMessage(playerid, -1, "[ERROR] - You need to wait 5 minutes before using this command!");
            }
            else
            {
                GivePlayerWeapon(playerid, 30, 320);
                GivePlayerWeapon(playerid, 29, 350);
                GivePlayerWeapon(playerid, 34, 10);
        SetPlayerSkin(playerid, 122);
            }
            return 1;
    }
    return 0;
}
NOT TESTED