CMD:drag need help
#1

pawn Код:
CMD:drag(playerid, params[])
{
    new giveplayerid, giveplayer[MAX_PLAYER_NAME], sendername[MAX_PLAYER_NAME], string[128], DragOff[MAX_PLAYERS];
    if(sscanf(params,"u",giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE,"USAGE: /drag [playerid]");
    if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COLOR_GREY, "That Player is offline !");
    if(!ProxDetectorS(3.0, playerid, giveplayerid)) return SendClientMessage(playerid, COLOR_GREY,"That player isn't near you !");
    if(DragOff[giveplayerid] > 0) return SendClientMessage(playerid, COLOR_GREY,"You are already being Dragged!");
    if(giveplayerid == playerid) return SendClientMessage(playerid, COLOR_GREY, "You Cannot Drag Yourself!");
    if(PlayerInfo[giveplayerid][pMember] == 1 || PlayerInfo[giveplayerid][pLeader] == 1)
    { return SendClientMessage(playerid, COLOR_GREY,"You can't drag cops"); }
    if(PlayerInfo[giveplayerid][pMember] == 1 || PlayerInfo[giveplayerid][pLeader] == 1)
    {
        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
        GetPlayerName(playerid, sendername, sizeof(sendername));
        format(string, sizeof(string), "* You are being dragged by %s,", sendername);
        SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
        format(string, sizeof(string), "* You begin to drag %s,", giveplayer);
        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
        format(string, sizeof(string), "* %s has started to drag %s.", sendername ,giveplayer);
        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        TogglePlayerControllable(giveplayerid, 0);
        DragOff[giveplayerid] = playerid;
    }
    else return SendClientMessage(playerid, COLOR_GREY,"You are not a cop");
    return 1;
}
How do I make it put them into the cop car?

Thanks
Reply
#2

Quote:
Originally Posted by UnknownGamer
Посмотреть сообщение
pawn Код:
CMD:drag(playerid, params[])
{
    new giveplayerid, giveplayer[MAX_PLAYER_NAME], sendername[MAX_PLAYER_NAME], string[128], DragOff[MAX_PLAYERS];
    if(sscanf(params,"u",giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE,"USAGE: /drag [playerid]");
    if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COLOR_GREY, "That Player is offline !");
    if(!ProxDetectorS(3.0, playerid, giveplayerid)) return SendClientMessage(playerid, COLOR_GREY,"That player isn't near you !");
    if(DragOff[giveplayerid] > 0) return SendClientMessage(playerid, COLOR_GREY,"You are already being Dragged!");
    if(giveplayerid == playerid) return SendClientMessage(playerid, COLOR_GREY, "You Cannot Drag Yourself!");
    if(PlayerInfo[giveplayerid][pMember] == 1 || PlayerInfo[giveplayerid][pLeader] == 1)
    { return SendClientMessage(playerid, COLOR_GREY,"You can't drag cops"); }
    if(PlayerInfo[giveplayerid][pMember] == 1 || PlayerInfo[giveplayerid][pLeader] == 1)
    {
        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
        GetPlayerName(playerid, sendername, sizeof(sendername));
        format(string, sizeof(string), "* You are being dragged by %s,", sendername);
        SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
        format(string, sizeof(string), "* You begin to drag %s,", giveplayer);
        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
        format(string, sizeof(string), "* %s has started to drag %s.", sendername ,giveplayer);
        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        TogglePlayerControllable(giveplayerid, 0);
        DragOff[giveplayerid] = playerid;
    }
    else return SendClientMessage(playerid, COLOR_GREY,"You are not a cop");
    return 1;
}
How do I make it put them into the cop car?

Thanks
you could make it like the cop in the vehicle can pull him in, it would be easier. if(!IsPlayerInVehicle(playerid)) return SendClientMessage(playerid,0xFF00FFFF,"You have to be in a Police vehicle to use this command");

so you could add:

PHP код:
new pvehicleid GetPlayerVehicleID(playerid)
if(
pvehicleid == 427 || pvehicleid == 490 || pvehicleid == 596 || pvehicleid == 597 || pvehicleid == 598//if it's a Enforcer, FBI Rancher, LSPD-, SFPD- or LVPD-Car
switch(random(2))
{
case 
0PutPlayerInVehicle(giveplayerid,pvehicleid,3);//back left passenger seat
case 1PutPlayerInVehicle(giveplayerid,pvehicleid,4);//back right passenger seat
}
}
else if(
pvehicleid == 423 || pvehicleid == 599//if it's a HPV-1000 or Police Rancher
{
PutPlayerInVehicle(giveplayerid,pvehicleid,2);//second seat|front right
}
else return 
SendClientMessage(playerid,0xFF00FFFF,"You have to be in a Police vehicle to do this!"); 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)