/vslap not working
#1

This is the code and It will not move the car into the air. Should I not use GetVehiclePos and SetVehiclePos?

pawn Код:
CMD:vslap(playerid, params[])
{
    new targetid, Float:x, Float:y, height, Float:z, string[128];
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "Only Administrators have access to this command");
    if(sscanf(params, "ui",targetid, height)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /vslap [id] [height]");
    if(targetid != INVALID_PLAYER_ID)
    {
        GetVehiclePos(targetid, x, y, z);
        SetVehiclePos(targetid, x, y, z+ height);
        format(string, sizeof(string),"Administrator %s has slapped your vehicle %d feet high",pName(playerid), height);
        SendClientMessage(targetid,COLOR_RED,string);
        format(string, sizeof(string),"You have slapped %s's vehicle %d feet high",pName(targetid), height);
        SendClientMessage(playerid,COLOR_RED,string);
    }
    return 1;
}
Reply
#2

pawn Код:
CMD:vslap(playerid, params[])
{
    new targetid, Float:x, Float:y, Float:height,v, Float:z, string[128];
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "Only Administrators have access to this command");
    if(sscanf(params, "uf",targetid, height)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /vslap [id] [height]");
    if(!IsPlayerInAnyVehicle(targetid)) return SendClientMessage(playerid, COLOR_RED, " ERROR: This player is not in a vehicle");

    new v=GetPlayerVehicleID(targetid);
    GetVehiclePos(v, x, y, z);
    SetVehiclePos(v, x, y, z+ height);
    format(string, sizeof(string),"Administrator %s has slapped your vehicle %d feet high",pName(playerid), height);
    SendClientMessage(targetid,COLOR_RED,string);
    format(string, sizeof(string),"You have slapped %s's vehicle %d feet high",pName(targetid), height);
    SendClientMessage(playerid,COLOR_RED,string);
    return 1;
}
Reply
#3

pawn Код:
CMD:vslap(playerid, params[])
{
    new targetid, Float:x, Float:y, height, Float:z, string[128];
    if(sscanf(params, "ui",targetid, height)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /vslap [id] [height]");
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "Only Administrators have access to this command");
    if(!IsPlayerConnected(targetit)) return SendClientMessage(playerid,COLOR_RED,"This player is not connected");
    if(!IsPlayerInAnyVehicle(targetid)) return SendClientMessage(playerid,COLOR_RED,"This player is not at any vehicle");
    new vehicleid=GetPlayerVehicleID(targetid);
    GetVehiclePos(targetid, x, y, z);
    SetVehiclePos(targetid, x, y, z+ height);
    format(string, sizeof(string),"Administrator %s has slapped your vehicle %d feet high",pName(playerid), height);
    SendClientMessage(targetid,COLOR_RED,string);
    format(string, sizeof(string),"You have slapped %s's vehicle %d feet high",pName(targetid), height);
    SendClientMessage(playerid,COLOR_RED,string);
    return 1;
}
SetVehiclePosition and getVehiclePosition uses the vehicleid parameter not the the targetid bro

fuuu i was late
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)