SA-MP Forums Archive
/drag 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: /drag command (/showthread.php?tid=70415)



/drag command - Shellegg - 24.03.2009

How can i create aa command that drag a player to the cop car?
Already saw that 2 times and but never saw the code.

Can anyone explain me how?

Thanks

Shellegg


Re: /drag command - Rks25 - 24.03.2009

search for command /pullincar


Re: /drag command - Danut - 24.03.2009

I've made it for GodFather

http://pastebin.com/m1eb1803c


Re: /drag command - Shellegg - 24.03.2009

But i dont use GF xD neigher a GD edit, this RP mode is different, but i think i can modifie it..

can i try with it?


Re: /drag command - MenaceX^ - 24.03.2009

Quote:
Originally Posted by Shellegg
But i dont use GF xD neigher a GD edit, this RP mode is different, but i think i can modifie it..

can i try with it?
You should understand, he gave you a pastebin link.


Re: /drag command - Dujma - 24.03.2009

You just need to add this and ProxDetector and ProxDetectorS


Re: /drag command - Rks25 - 24.03.2009

and IsACop.
What i would do is modify it .


Re: /drag command - Shellegg - 24.03.2009

what is SendClientMessage(playerid, COLOR_GREY, POLICE_TEXT);?


Re: /drag command - Rks25 - 24.03.2009

change that POLICE_TEXT to : "You are not a cop"


Re: /drag command - Shellegg - 24.03.2009

i tryed to add in my GM but got ssome errors, can you please tell me how to fix it?

Quote:

if(strcmp(cmd, "/meternocarro", true) ==0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pFaction] != 255 && DynamicFactions[PlayerInfo[playerid][pFaction]][fType] == 1)
{
if(CopOnDuty[playerid] == 0)
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "Nгo estбs em duty!");
}
if(PlayerCuffed[giveplayerid] == 0)
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "O suspeito precisa ser algemado antes de ser posto no carro!");
}
if(IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "Precisas estar fora do carro para por o suspeito lб dentro.");
return 1;
}
if(IsPlayerConnected(giveplayerid))
{
if (ProxDetectorS(8.0, playerid, giveplayerid))
{
new carid = gLastCar[playerid];
tmp = strtok(cmdtext, idx);
if (!strlen(tmp))
return SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "/meternocarro [playerid/PartOfName] [seatid]");
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if (!strlen(tmp))
return SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "/meternocarro [playerid/PartOfName] [seatid]");
new seat = strval(tmp);
if(seat < 0 || seat > 3)
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "O seatid tem de ser entre 1 e 3");
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "0 - Condutor");
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "1 - Pendura");
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "2 - Passageiro");
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "3 - Passageiro");
return 1;
}
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "Foste detido pelo agente %s .", sendername);
SendClientMessage(giveplayerid, COLOR_LIGHTYELLOW2, string);
format(string, sizeof(string), "Detes-te o suspeito %s .", giveplayer);
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, string);
PlayerPlayerActionMessage(playerid,suspect,15.0,"% s pega o suspeito %s e mete-o dentro do carro.", sendername ,giveplayer);
GameTextForPlayer(giveplayerid, "~r~BUSTED", 2500, 3);
ClearAnimations(giveplayerid);
TogglePlayerControllable(giveplayerid, 0);
PutPlayerInVehicle(giveplayerid,carid,seat);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Precisas estar perto do teu carro!");
return 1;
}
}
else
{
format(string, sizeof(string), "%s nгo estб online", giveplayerid);
SendClientMessage(playerid, COLOR_WHITE, string);
}
}
}
return 1;
}


COMPILE:
Quote:

C:\Documents and Settings\Proprietбrio\Ambiente de trabalho\Opadrinho\gamemodes\crp.pwn(5842) : warning 217: loose indentation
C:\Documents and Settings\Proprietбrio\Ambiente de trabalho\Opadrinho\gamemodes\crp.pwn(5846) : warning 217: loose indentation
C:\Documents and Settings\Proprietбrio\Ambiente de trabalho\Opadrinho\gamemodes\crp.pwn(5855) : error 017: undefined symbol "gLastCar"
C:\Documents and Settings\Proprietбrio\Ambiente de trabalho\Opadrinho\gamemodes\crp.pwn(5855) : warning 215: expression has no effect
C:\Documents and Settings\Proprietбrio\Ambiente de trabalho\Opadrinho\gamemodes\crp.pwn(5855) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Proprietбrio\Ambiente de trabalho\Opadrinho\gamemodes\crp.pwn(5855) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Proprietбrio\Ambiente de trabalho\Opadrinho\gamemodes\crp.pwn(5855) : fatal error 107: too many error messages on one line



BOLD LINES ARE ERRORS

Thanks