Just a little help
#1

Ok i know this is a easy script to do but i forgot what its called to learn how to do it

basically i have a code that works for one thing but i want to work for more than one

such as

Код:
if(strcmp(cmd, "/drag", true) == 0)
	{
  tmp = strtok(cmdtext, idx);
  if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /drag (playerid)");
  giveplayerid = strvalEx(tmp);
  	new playa;
	new otherplayer = strvalEx(tmp);
	GetPlayerName(playa, giveplayer, sizeof(giveplayer));
	GetPlayerName(playerid, sendername, sizeof(sendername));
  if(PlayerData[playerid][Medic] < 1) return SendClientMessage(playerid, RED, "SERVER MESSAGE: You need to be medic rank 1 to do this.");
  	if(PlayerData[playerid][Mduty] == 0) return SendClientMessage(playerid, RED, "You are not in Medic duty");
  	if (GetDistanceBetweenPlayers(playerid,giveplayerid) > 8.00)
  {
	SendClientMessage(playerid,COLOR_RED1,"You are too far away!!");
  return 1;
	}
   if(otherplayer == playerid)
  {
  SendClientMessage(playerid, RED, "You can't drag yourself!");
  return 1;
  }
  if(IsPlayerInAnyVehicle(playerid))
  {
  if (GetDistanceBetweenPlayers(playerid,giveplayerid) > 8.00)
  {
	SendClientMessage(playerid,COLOR_RED1,"You are too far away!!");
  return 1;
	}
  if(IsPlayerConnected(giveplayerid))
  {	
PutPlayerInVehicle(giveplayerid, medicar1, 2);
	return 1;
	}
	}
	}
You see it has "PutPlayerInVehicle(giveplayerid, medicar1, 2);" i want to make it for medicar2 medicar3 aswell

how i do this?

thanks
Reply
#2

Why don't you do something like

pawn Код:
new car = GetVehicleID(playerid);
pawn Код:
PutPlayerInVehicle(giveplayerid, car, 2);
Then the player who get /dragged will get in the car of the playerid.
Reply
#3

word
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)