SA-MP Forums Archive
/tow problem - 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: /tow problem (/showthread.php?tid=338803)



/tow problem - diablo16 - 01.05.2012

Hi i need help with this command so the members from T.T.C Faction can tow more then one car per PayDay (10 cars).
~~Please if you can make the code with 10 cars.

Here is the code:
Код:
if(strcmp(cmd, "/tow", true) == 0)
	{
	  	if(IsPlayerConnected(playerid))
	   	{
		    tmp = strtok(cmdtext, idx);
		    if(!strlen(tmp))
		    {
		     	SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /tow [LS or SF]");
		     	return 1;
		    }
		    new newcar = GetPlayerVehicleID(playerid);
    		new x_nr[256];
		   	x_nr = strtok(cmdtext, idx);
		   	if(strcmp(x_nr,"ls",true) == 0)
		   	{
				if(PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 16)
				{
					if(!IsATowcar(newcar))
					{
					    if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
						{
						    if(PlayerInfo[playerid][pTow] >= 1)
						    {
						        PlayerInfo[playerid][pTow] -= 1;
						    	CP[playerid] = 111;
								SetPlayerCheckpoint(playerid, 2412.4646,-1426.3083,23.9848, 5.0);
								SendClientMessage(playerid, COLOR_YELLOW, "Drive to Warehouse to destroy the towed car.");
							}
							else
							{
							    SendClientMessage(playerid, COLOR_GRAD1, "	You cannot tow any car till PayDay.");
							}
						}
						else
						{
						    SendClientMessage(playerid, COLOR_GRAD1, "   You dont towed a car !");
						}
					}
					else
					{
						SendClientMessage(playerid, COLOR_GRAD1, "   You are not in a Tow Truck !");
					}
				}
			}
		}
		new x_nr[256];
		new newcar = GetPlayerVehicleID(playerid);
 		x_nr = strtok(cmdtext, idx);
  		if(strcmp(x_nr,"sf",true) == 0)
   		{
		    if(IsPlayerConnected(playerid))
		    {
				if(PlayerInfo[playerid][pMember] == 16 || PlayerInfo[playerid][pLeader] == 16)
				{
					if(!IsATowcar(newcar))
					{
					    if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
						{
						    if(PlayerInfo[playerid][pTow] >= 1)
						    {
						        PlayerInfo[playerid][pTow] -= 1;
						    	CP[playerid] = 111;
								SetPlayerCheckpoint(playerid, 1617.2562,-2314.1616,13.5537, 5.0);
								SendClientMessage(playerid, COLOR_YELLOW, "Drive to Warehouse to destroy the towed car.");
							}
							else
							{
							    SendClientMessage(playerid, COLOR_GRAD1, "	You cannot tow any car till PayDay.");
							}
						}
						else
						{
						    SendClientMessage(playerid, COLOR_GRAD1, "   You dont towed a car !");
						}
					}
					else
					{
						SendClientMessage(playerid, COLOR_GRAD1, "   You are not in a Tow Truck !");
					}
				}
			}
			return 1;
		}
	}



Re: /tow problem - warcodes_ - 01.05.2012

You are asking us to make something work with something else, we will need to know what those variables are called to even start.


Re: /tow problem - diablo16 - 01.05.2012

Tell me wath variables you need so i can give them to you