Just a little help - 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: Just a little help (
/showthread.php?tid=128391)
Just a little help -
[LSB]TheGame - 17.02.2010
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
Re: Just a little help -
VonLeeuwen - 17.02.2010
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.
Re: Just a little help -
[LSB]TheGame - 17.02.2010
word