Trooper's CMD Help Topic - 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: Trooper's CMD Help Topic (
/showthread.php?tid=293537)
Trooper's CMD Help Topic -
State_Trooper - 29.10.2011
Код:
CMD:tazer(playerid, params[])
{
if(gTeam[playerid] == 2 || IsACop(playerid) || (PlayerInfo[playerid][pMember] == 4 && PlayerInfo[playerid][pDivision] == 2) || (PlayerInfo[playerid][pMember] == 4 && PlayerInfo[playerid][pRank] >= 5) || (PlayerInfo[playerid][pMember] == 12 && PlayerInfo[playerid][pDivision] == 2) || (PlayerInfo[playerid][pMember] == 9 && PlayerInfo[playerid][pDivision] == 1))
{
new string[128];
if(PlayerInfo[playerid][pConnectTime] < 2 || PlayerInfo[playerid][pWRestricted] > 0) return SendClientMessageEx(playerid, COLOR_GRAD2, "You cannot use this as you are currently restricted from possessing weapons!");
if(IsPlayerInAnyVehicle(playerid))
{
SendClientMessageEx(playerid, COLOR_GREY, "You can't do this while you're in a vehicle.");
return 1;
}
if(GetPVarInt(playerid, "IsInArena") >= 0)
{
SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this right now, you are in a arena!");
return 1;
}
if(GetPVarInt( playerid, "EventToken") != 0)
{
SendClientMessageEx(playerid, COLOR_GREY, "You can't use the tazer while you're in an event.");
return 1;
}
if(PlayerCuffedTime[playerid] > 0)
{
SendClientMessageEx(playerid, COLOR_GREY, "You can't do this right now.");
return 1;
}
if(GetPVarInt(playerid, "Injured") == 1)
{
SendClientMessageEx(playerid, COLOR_GREY, "You can't do this right now.");
return 1;
}
if(PlayerInfo[playerid][pJailed] > 0)
{
SendClientMessageEx(playerid, COLOR_WHITE, "You cannot use this in jail/prison.");
return 1;
}
if(PlayerCuffed[playerid] >= 1) {
SendClientMessageEx(playerid, COLOR_WHITE, "You cannot use this while tazed/cuffed.");
return 1;
}
if(pTazer[playerid] == 0)
{
pTazerReplace[playerid] = PlayerInfo[playerid][pGuns][2];
if(PlayerInfo[playerid][pGuns][2] != 0) RemovePlayerWeapon(playerid, PlayerInfo[playerid][pGuns][2]);
format(string, sizeof(string), "* %s unholsters their tazer.", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
GivePlayerValidWeapon(playerid, 23, 60000);
pTazer[playerid] = 1;
}
else
{
RemovePlayerWeapon(playerid, 23);
GivePlayerValidWeapon(playerid, pTazerReplace[playerid], 60000);
format(string, sizeof(string), "* %s holsters their tazer.", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
pTazer[playerid] = 0;
}
}
else
{
SendClientMessageEx(playerid, COLOR_GREY, " You are not a Cop / FBI / Coastguard!");
return 1;
}
return 1;
}
This is just a post to help everyone with some cmds
Re: Trooper's CMD Help Topic -
State_Trooper - 29.10.2011
Код:
CMD:badge(playerid, params[]) {
if((IsACop(playerid) || PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4 || PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12) && GetPVarInt(playerid, "IsInArena") < 0 && !GetPVarInt(playerid, "EventToken") && PlayerInfo[playerid][pJailed] == 0 || PlayerInfo[playerid][pMember] == 9 && PlayerInfo[playerid][pDivision] == 1) {
if(PlayerInfo[playerid][pDuty]) {
PlayerInfo[playerid][pDuty] = 0;
SetPlayerToTeamColor(playerid);
SendClientMessageEx(playerid, COLOR_WHITE, "You have hidden your badge, and will now be identified as being off-duty.");
}
else {
PlayerInfo[playerid][pDuty] = 1;
SetPlayerToTeamColor(playerid);
SendClientMessageEx(playerid, COLOR_WHITE, "You have shown your badge, and will now be identified as being on-duty.");
}
}
return 1;
}
/badge Command
where it show when your on duty or not on duty
Re: Trooper's CMD Help Topic -
Lorenc_ - 29.10.2011
iget thusand eror pls help me
undfine playerinfo hlp!
Re: Trooper's CMD Help Topic -
ahbir_jhon - 29.10.2011
u also have to check ur version and inc what ur using before useing pwno
Re: Trooper's CMD Help Topic -
State_Trooper - 29.10.2011
Lorenc_
i know your a gud scripter and u have script for me before no need to lie cuz i have you on MSN & Skype