SA-MP Forums Archive
CMD:vr(playerid, params[]) dont work :( - 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)
+--- Thread: CMD:vr(playerid, params[]) dont work :( (/showthread.php?tid=399583)



CMD:vr(playerid, params[]) dont work :( - dr.lozer - 15.12.2012

EDIT: its fixed

When i type this cmd

it returns INVALID_CMD ( message sends "unkown command" ) xD

here is the command

pawn Код:
PUBLIC:vr(playerid, vehicleid)
{
    new Float:x,Float:y,Float:z;
    GetVehiclePos(vehicleid, x,y,z);
    if(IsPlayerInRangeOfPoint(playerid, 3.0,x,y,z)) {
        new Float:health; GetVehicleHealth(vehicleid, health);
        if(health < 100) {
            SetVehicleHealth(vehicleid, health+15);
        }else {
            SetVehicleHealth(vehicleid, 100.0);
            KillTimer(Timer1[playerid]);
            SendClientMessage(playerid, COLOR_RED,"[ERROR] Vehicle is repaired");
        }
    }
    return 1;
}

CMD:rv(playerid, params[])
{
    if(IsPlayerVS[playerid] == 0) {
        SendClientMessage(playerid, COLOR_RED,"[ERROR] You cant use this command, only Vehicle Support can");
        return 1;
    }
    new vehicleid;
    if(sscanf(params,"i",vehicleid)) {
        SendClientMessage(playerid, COLOR_GREY,"[USAGE] /rv [vehicleid]");
        return 1;
    }
    if(vehicleid == INVALID_VEHICLE_ID) {
        SendClientMessage(playerid, COLOR_RED,"[ERROR] Invalid ID");
        return 1;
    }
    new Float:x,Float:y,Float:z;
    GetVehiclePos(vehicleid, x,y,z);
    if(IsPlayerInRangeOfPoint(playerid, 3.0,x,y,z)) {
        Timer1[playerid] = SetTimerEx("vr",500,0,"ii",playerid,vehicleid);
    }else {
        SendClientMessage(playerid, COLOR_RED,"[ERROR] Your not near that vehicle");
    }
    return 1;
}



Re: CMD:vr(playerid, params[]) dont work :( - [HK]Ryder[AN] - 15.12.2012

thats cause the command is rv not vr


Re: CMD:vr(playerid, params[]) dont work :( - RajatPawar - 15.12.2012

Quote:

PUBLIC:vr(playerid, vehicleid)
{
new Float,Float:y,Float:z;
GetVehiclePos(vehicleid, x,y,z);
if(IsPlayerInRangeOfPoint(playerid, 3.0,x,y,z)) {
new Float:health; GetVehicleHealth(vehicleid, health);
if(health < 100) {
SetVehicleHealth(vehicleid, health+15);
}else {
SetVehicleHealth(vehicleid, 100.0);
KillTimer(Timer1[playerid]);
SendClientMessage(playerid, COLOR_RED,"[ERROR] Vehicle is repaired");
}
}
return 1;
}

What is this, a new type of command creation? PUBLIC: ?

Quote:
Originally Posted by [HK]Ryder[AN]
Посмотреть сообщение
thats cause the command is rv not vr
And lol'ed.


Re: CMD:vr(playerid, params[]) dont work :( - dr.lozer - 15.12.2012

Quote:
Originally Posted by [HK]Ryder[AN]
Посмотреть сообщение
thats cause the command is rv not vr
what?? i didn't understand.. when i said i use /vr

OH!!! the title ops

EDIT: hmmm your right.. maybe i type wrong cmd xD lemme go check this works


Re: CMD:vr(playerid, params[]) dont work :( - dr.lozer - 15.12.2012

Quote:
Originally Posted by Rajat_Pawar
Посмотреть сообщение
What is this, a new type of command creation? PUBLIC: ?


And lol'ed.
dude i use the PUBLIC: like this

pawn Код:
#define PUBLIC:%1(%2) forward %1(%2); public %1(%2)
and by the way i typed in game /vr xD


Re: CMD:vr(playerid, params[]) dont work :( - [HK]Ryder[AN] - 15.12.2012

so, i was right?