/createcar with 'Car name'
#1

Hi guys. I have made a command to create different cars by their ID.
Question: How to make instead ID , car's name ?!!

Pawno code:

Код:
if(strcmp(cmd,"/createcar",true)==0) {
	if(IsPlayerLevel(playerid,10)) {
	tmp = strtok(cmdtext,idx);	if (!strlen(tmp)) { SendClientMessage(playerid,COLOUR_ORANGE,"Usage: /CREATCAR <ID> (400-604)"); return 1; }
	if (strval(tmp)<400) { SendClientMessage(playerid,COLOUR_ORANGE,"Usage: /CREATCAR <ID> (400-604)"); return 1; }
	if (strval(tmp)>604) { SendClientMessage(playerid,COLOUR_ORANGE,"Usage: /CREATCAR <ID> (400-604)"); return 1; }

	new State = GetPlayerState(playerid);
	if (State>1) { SendClientMessage(playerid,red," Error: Invlaid ID"); return 1; }

	if(creatcar!=-1) DestroyVehicle(creatcar);

	new Float:pos[4];
	GetPlayerPos(playerid, pos[0],pos[1],pos[2]);
	GetPlayerFacingAngle(playerid,pos[3]);
	creatcar = CreateVehicle(strval(tmp),pos[0],pos[1],pos[2],pos[3],-1,-1,10);
	PutPlayerInVehicle(playerid,creatcar,0);

			new i;
			for(i=0;i<MAX_PLAYERS;i++)
			{
				if(i != playerid)
				{
					SetVehicleParamsForPlayer(creatcar,i, 0, 1);
				}
			}

	} else AdminError(playerid,10);
return 1;
}
Reply


Messages In This Thread
/createcar with 'Car name' - by Headyheadster - 27.02.2010, 07:38
Re: /createcar with 'Car name' - by smeti - 27.02.2010, 09:46
Re: /createcar with 'Car name' - by Headyheadster - 27.02.2010, 12:13

Forum Jump:


Users browsing this thread: 1 Guest(s)