I need Drag and stop drag command
#1

Can someone help me? Just create it please, I'll match the scripts with my GM.
Reply
#2

From: https://sampforum.blast.hk/showthread.php?tid=280379

hope it works !

pawn Код:
CMD:drag(playerid, params[])
{
    new giveplayerid, giveplayer[MAX_PLAYER_NAME], sendername[MAX_PLAYER_NAME], string[128], DragOff[MAX_PLAYERS];
    if(sscanf(params,"u",giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE,"USAGE: /drag [playerid]");
    if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COLOR_GREY, "That Player is offline !");
    if(!ProxDetectorS(3.0, playerid, giveplayerid)) return SendClientMessage(playerid, COLOR_GREY,"That player isn't near you !");
    if(DragOff[giveplayerid] > 0) return SendClientMessage(playerid, COLOR_GREY,"You are already being Dragged!");
    if(giveplayerid == playerid) return SendClientMessage(playerid, COLOR_GREY, "You Cannot Drag Yourself!");
    if(gTeam[giveplayerid] == 2 || IsACop(giveplayerid) || PlayerInfo[giveplayerid][pMember] == 2 || PlayerInfo[giveplayerid][pMember] == 6 || PlayerInfo[giveplayerid][pLeader] == 6)
    { return SendClientMessage(playerid, COLOR_GREY,"You can't drag cops"); }
    if(gTeam[playerid] == 2 || IsACop(playerid) || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6)
    {
        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
        GetPlayerName(playerid, sendername, sizeof(sendername));
        format(string, sizeof(string), "* You are being dragged by %s,", sendername);
        SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
         format(string, sizeof(string), "* You begin to drag %s,", giveplayer);
         SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
         format(string, sizeof(string), "* %s has started to drag %s.", sendername ,giveplayer);
         ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
         TogglePlayerControllable(giveplayerid, 0);
         DragOff[giveplayerid] = playerid;
    }
    else return SendClientMessage(playerid, COLOR_GREY,"You are not a cop");
    return 1;
}
Reply
#3

Not work bro
Reply
#4

Quote:
Originally Posted by Jizz
Посмотреть сообщение
Not work bro
Maybe you use strcmp...
try this

Код:
	if(strcmp(cmd, "/drag", true) == 0) 
	{
	    if(IsPlayerConnected(playerid))
	    {
	        if(!IsACop(playerid) && !IsAGovMember(playerid))
			{
			    SendClientMessage(playerid, COLOR_GRAD1, "You are not a cop!");
			    return 1;
			}
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /drag [playerid/PartOfName]");
				return 1;
			}
			if(PlayerInfo[playerid][pDBanned] == 1)
			{
			    SendClientMessage(playerid, COLOR_GREY, "** You are Banned From Cop Duty!");
 				return 1;
			}
			new newcar = GetPlayerVehicleID(playerid);
			new playa;
			playa = ReturnUser(tmp);
			if(IsACopCar(newcar) || IsNgCar(newcar) || IsAnFbiCar(newcar) || IsAGovernmentCar(newcar))
			{
			    if(IsPlayerConnected(playa))
			    {
			        if(playa != INVALID_PLAYER_ID)
			        {
			            new Float:x, Float:y, Float:z;
			            GetPlayerPos(playa,x,y,z);
			            if(IsPlayerInRangeOfPoint(playerid, 5, x, y, z))
			            {
			            	PutPlayerInVehicle(playa,newcar,1);
			            	GetPlayerName(playa, giveplayer, sizeof(giveplayer));
							format(string, sizeof(string), "* %s drags %s to his/her car/moped.", sendername ,giveplayer);
							ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
							new y1, m, d;
							new h,mi,s;
							getdate(y1,m,d);
							gettime(h,mi,s);
							format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /drag %s",d,m,y1,h,mi,s,sendername,giveplayer);
							CommandLog(string);
						}
						else
						{
							SendClientMessage(playerid, COLOR_GREY, "Player is not near you.");
						}
					}
			    }
			}
			else
			{
			    SendClientMessage(playerid, COLOR_GRAD1, "You are not in police vehicle!");
			}
	    }
	    return 1;
	}
Command will place player in car on backseat.
Reply
#5

I'm using ZCMD.
Reply
#6

It's work, but i need an undrag script can you help me
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)