I need Drag and stop drag command
#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


Messages In This Thread
I need Drag and stop drag command - by Jizz - 26.09.2013, 07:50
Re: I need Drag and stop drag command - by Voxel - 26.09.2013, 11:05
Re: I need Drag and stop drag command - by Jizz - 26.09.2013, 14:48
Re: I need Drag and stop drag command - by ***Niko*** - 26.09.2013, 15:56
Re: I need Drag and stop drag command - by Jizz - 26.09.2013, 17:50
Re: I need Drag and stop drag command - by adihanifsdr - 24.02.2014, 12:08

Forum Jump:


Users browsing this thread: 3 Guest(s)