SA-MP Forums Archive
Help with command - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help with command (/showthread.php?tid=71638)



Help with command - Linxx87 - 02.04.2009

Elo guys can anyone help me with this im trying to make it so i can /sellcar(id)(ammount) but im not shore ow u do it any ideas regards linxx
Код:
	if (strcmp(cmd, "/sellveh", true) ==0 )
	{
		if(!IsPlayerInAnyVehicle(playerid)){return 1;}
		if(GetCreatorID(vehicleid)!=0)
		{
			if (strmatch(VehicleSystem[GetCreatorID(vehicleid)][owner],Spielername(playerid)))
			{

			if(!strlen(tmp)){SendClientMessage(playerid,WHITE,"INFO: /sellveh [Price]");return 1;}
			new Float:vx,Float:vy,Float:vz,Float:va;
			GetVehiclePos(GetPlayerVehicleID(playerid),vx,vy,vz);
			GetVehicleZAngle(GetPlayerVehicleID(playerid),va);
			VehicleSystem[GetCreatorID(vehicleid)][x]=vx;
			VehicleSystem[GetCreatorID(vehicleid)][y]=vy;
			VehicleSystem[GetCreatorID(vehicleid)][z]=vz;
			VehicleSystem[GetCreatorID(vehicleid)][a]=va;
			VehicleSystem[GetCreatorID(vehicleid)][preis]=strval(tmp);
			if(strval(tmp) > 10000 || strval(tmp) < 0) return SendClientMessage(playerid, red, "Invalid cash ammount 0-1000");
			strmid(VehicleSystem[GetCreatorID(vehicleid)][owner],"dealercar",0,128,128);
			SendClientMessage(playerid,WHITE,"This vehicle is now for Sale!");
			GivePlayerMoney(playerid,strval(tmp));
			SaveTool();
			}
			else
			{
				SendClientMessage(playerid,WHITE,"This Vehicle isnt yours!");
			}
		}
		return 1;
	}



Re: Help with command - MenaceX^ - 02.04.2009

Two strtoks.