/crash not crashing players
#1

This only works while i am not in a car, but to use the command properly it is needed to be in a car

When i do it in a car it says unknown command

pawn Код:
if(strcmp(cmd, "/apark", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            new Float:x,Float:y,Float:z;
            new Float:a;
            new carid;
            carid = GetPlayerVehicleID(playerid);
            GetPlayerName(playerid, playername, sizeof(playername));
            GetVehiclePos(carid, x, y, z);
            GetPlayerFacingAngle(playerid, a);
            GetVehicleZAngle(carid, a);
            if(PlayerInfo[playerid][pAdmin] >= 1340)
            {
                CarInfo[carid][cLocationx] = x;
                CarInfo[carid][cLocationy] = y;
                CarInfo[carid][cLocationz] = z;
                CarInfo[carid][cAngle] = a;
                format(string, sizeof(string), "~n~ You have parked your car in this location. ~n~");
                GameTextForPlayer(playerid, "You have parked this car in this position. It will respawn here.", 10000, 3);
                OnPropUpdate();
                OnPlayerUpdate(playerid);
                DestroyVehicle(carid);
                CreateVehicle(CarInfo[carid][cModel],CarInfo[carid][cLocationx],CarInfo[carid][cLocationy],CarInfo[carid][cLocationz]+1.0,CarInfo[carid][cAngle],CarInfo[carid][cColorOne],CarInfo[carid][cColorTwo],60000);
                return 1;
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   You are not authorized to use that command !");
                return 1;
            }
        }
        return 1;
    }


Crash command = Fixed
Reply
#2

pawn Код:
if(strcmp(cmd, "/crash", true) == 0)
{
    if(AccInfo[playerid][Level] >= 4)
    {
        if(isnull(params)) return
        Inter_SendClientMessage(playerid, LIGHTBLUE2, "Usage: /crash [PlayerID]") &&
        Inter_SendClientMessage(playerid, orange, "Function: Will Crash a specified player");

        new player1 = strval(params), string[128], Float:X,Float:Y,Float:Z;
        if(AccInfo[player1][Level] == ServerInfo[MaxAdminLevel] && AccInfo[playerid][Level] != ServerInfo[MaxAdminLevel])
        return Inter_SendClientMessage(playerid,red,"ERROR: You cannot use this command on this admin");
        if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID)
        {
            SendCommandToAdmins(playerid,"Crash");
            GetPlayerPos(player1,X,Y,Z);
            new CrashObj = CreatePlayerObject(player1,11111111,X,Y,Z,0,0,0);
            DestroyObject(CrashObj);
            format(string, sizeof(string), "|- You have Crashed \"%s's\" -|", PlayerName2(player1));
            return Inter_SendClientMessage(playerid,blue, string);
        }
        else return ErrorMessages(playerid, 2);
    }
    else return ErrorMessages(playerid, 1);
}

please try this
Reply
#3

pawn Код:
if(strcmp(cmd, "/crash", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "SYNTAX: /crash [playerid/PartOfName]");
    return 1;
    }
    giveplayerid = ReturnUser(tmp);
    if (PlayerInfo[playerid][pAdmin] >= 1337)
    {
    if(IsPlayerConnected(giveplayerid))
    {
        if(giveplayerid != INVALID_PLAYER_ID)
        {
        GameTextForPlayer(giveplayerid, "•¤¶§!$$%&'()*+,-./01~!@#$^&*()_-+={[}]:;'<,>.?/", 1000, 0);
    GameTextForPlayer(giveplayerid, "•¤¶§!$$%&'()*+,-./01~!@#$^&*()_-+={[}]:;'<,>.?/", 2000, 1);
    GameTextForPlayer(giveplayerid, "•¤¶§!$$%&'()*+,-./01~!@#$^&*()_-+={[}]:;'<,>.?/", 3000, 2);
    GameTextForPlayer(giveplayerid, "•¤¶§!$$%&'()*+,-./01~!@#$^&*()_-+={[}]:;'<,>.?/", 4000, 3);
    GameTextForPlayer(giveplayerid, "•¤¶§!$$%&'()*+,-./01~!@#$^&*()_-+={[}]:;'<,>.?/", 5000, 4);
    GameTextForPlayer(giveplayerid, "•¤¶§!$$%&'()*+,-./01~!@#$^&*()_-+={[}]:;'<,>.?/", 6000, 5);
    GameTextForPlayer(giveplayerid, "•¤¶§!$$%&'()*+,-./01~!@#$^&*()_-+={[}]:;'<,>.?/", 7000, 6);
        format(string, sizeof(string), "You have crashed \"%s's\" game", giveplayer);
        SendClientMessage(playerid,COLOR_DBLUE, string);
        return 1;
    }
    }
    }
    else
    {
    format(string, sizeof(string), "   %d is not an active player.", giveplayerid);
    SendClientMessage(playerid, COLOR_GRAD1, string);
    }
    }
    return 1;
    }
Reply
#4

Quote:
Originally Posted by dannyk0ed
Посмотреть сообщение
pawn Код:
if(strcmp(cmd, "/crash", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "SYNTAX: /crash [playerid/PartOfName]");
    return 1;
    }
    giveplayerid = ReturnUser(tmp);
    if (PlayerInfo[playerid][pAdmin] >= 1337)
    {
    if(IsPlayerConnected(giveplayerid))
    {
        if(giveplayerid != INVALID_PLAYER_ID)
        {
        GameTextForPlayer(giveplayerid, "•¤¶§!$$%&'()*+,-./01~!@#$^&*()_-+={[}]:;'<,>.?/", 1000, 0);
    GameTextForPlayer(giveplayerid, "•¤¶§!$$%&'()*+,-./01~!@#$^&*()_-+={[}]:;'<,>.?/", 2000, 1);
    GameTextForPlayer(giveplayerid, "•¤¶§!$$%&'()*+,-./01~!@#$^&*()_-+={[}]:;'<,>.?/", 3000, 2);
    GameTextForPlayer(giveplayerid, "•¤¶§!$$%&'()*+,-./01~!@#$^&*()_-+={[}]:;'<,>.?/", 4000, 3);
    GameTextForPlayer(giveplayerid, "•¤¶§!$$%&'()*+,-./01~!@#$^&*()_-+={[}]:;'<,>.?/", 5000, 4);
    GameTextForPlayer(giveplayerid, "•¤¶§!$$%&'()*+,-./01~!@#$^&*()_-+={[}]:;'<,>.?/", 6000, 5);
    GameTextForPlayer(giveplayerid, "•¤¶§!$$%&'()*+,-./01~!@#$^&*()_-+={[}]:;'<,>.?/", 7000, 6);
        format(string, sizeof(string), "You have crashed \"%s's\" game", giveplayer);
        SendClientMessage(playerid,COLOR_DBLUE, string);
        return 1;
    }
    }
    }
    else
    {
    format(string, sizeof(string), "   %d is not an active player.", giveplayerid);
    SendClientMessage(playerid, COLOR_GRAD1, string);
    }
    }
    return 1;
    }
Worked, thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)