Destroy Vehicle Command help
#1

I need little help here:
Here is the code:

PHP код:
dcmd_dv(playeridparams[])
#pragma unused params
{
    if(
IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdminLevel] > 0)
    {
        new 
var0 0;
        new 
var1[24];
        new 
var2[256];
        new 
var3[256];
        [
B]var3 function1B8C(arg1var032);[/B]
        if(!
strlen(var3))
        {
            
SendClientMessage(playerid0xFF0000FF"USAGE: /dv (vehicleid)");
            return 
1;
        }
        
var0 strval(var3);
        for(new 
var4 0GetMaxPlayers() > var4var4++)
        {
            if(
IsPlayerInVehicle(var4var0))
            {
                
SendClientMessageToAll(0xFF0000FF"You Can't Destroy A Vehicle With Someone In It.");
                return 
1;
            }
            
GetPlayerName(playeridvar124);
            
format(var2256"%s Destroyed Vehicleid: (%d)."var1var0);
            
DestroyVehicle(var0);
            return 
1;
        }
    }else{
    
SendClientMessage(playeridCOLOR_ERROR"Unknown Command! Type /cmds For Available Commands.");
    }
    return 
1;

I'm getting errors:
PHP код:
D:\...(15724) : error 017undefined symbol "function1B8C" //Check Bold line in code
D:\...(15724) : error 033: array must be indexed (variable "var3"//Check Bold line in code
2 Errors
Looking for solutions, Thanks
Reply
#2

Dont use dcmd its lagging old shit. Use Pawn.CMD for fastest speed around here.
PHP код:
cmd:dv(pid,p[]){ 
    if(!
IsPlayerAdmin(pid) && !PlayerInfo[pid][pAdminLevel])return scm(pid,-1,"Not admin!");
    new 
vid;
    if(
sscanf(p,"d",vid))return scm(pid,-1,"/dv [VID]");
    if(!
IsValidVehicle(vid))return scm(pid,-1,"Vehicle with scuh ID doesn't exsist!");
    foreach(
Player,i)if(GetPlayerVehicleID(i)==vid)return scm(pid,-1,"Somebody is in the vehicle!");
    
DestroyVehicle(vid);
    
scm(pid,-1,"Vehicle destroyed.");
    return 
1

Reply
#3

Quote:
Originally Posted by CodeStyle175
Посмотреть сообщение
Dont use dcmd its lagging old shit. Use Pawn.CMD for fastest speed around here.
PHP код:
cmd:dv(pid,p[]){ 
    if(!
IsPlayerAdmin(pid) && !PlayerInfo[pid][pAdminLevel])return scm(pid,-1,"Not admin!");
    new 
vid;
    if(
sscanf(p,"d",vid))return scm(pid,-1,"/dv [VID]");
    if(!
IsValidVehicle(vid))return scm(pid,-1,"Vehicle with scuh ID doesn't exsist!");
    foreach(
Player,i)if(GetPlayerVehicleID(i)==vid)return scm(pid,-1,"Somebody is in the vehicle!");
    
DestroyVehicle(vid);
    
scm(pid,-1,"Vehicle destroyed.");
    return 
1

Woah, that was fast answer!
Reputation earned! +1

I only know how to script in DCMD because it's classic to me.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)