SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 27/03/2014, 12:20 PM   #1
Sweez
Huge Clucker
 
Join Date: Apr 2012
Location: Varna, Bulgaria/ Варна, Българ
Posts: 347
Reputation: 3
Default Vehicle Creation

Hello, i've just found a bug and i cannot fix it. When i try to create a vehicle, it gives me an error, look at my lines:

pawn Code:
else if(!strcmp(option, "vehicle", true, 7))
    {
        if(sscanf(params, "is[32]iiii", idx, option, veh, vehid, col1, col2)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /oedit [orgslot] vehicle [vehiclelot] [vehiclemodel] [color1] [color2]");
        if(veh < 1 || veh > 5) return SendClientMessage(playerid, COLOR_GREY, "Vehicle slots are between 1 and 5.");
        veh = veh-1;
        if(FamInfo[idx][fVehType][veh])
        {
            FamInfo[idx][fVehType][veh] = 0;
            FamInfo[idx][fVehCoX][veh] = 0;
            FamInfo[idx][fVehCoY][veh] = 0;
            FamInfo[idx][fVehCoZ][veh] = 0;
            FamInfo[idx][fVehRot][veh] = 0;
            FamInfo[idx][fVehCol1][veh] = 0;
            FamInfo[idx][fVehCol2][veh] = 0;
            DestroyVehicle(FamInfo[idx][fVeh][veh]);
        }
        if(vehid)
        {
            FamInfo[idx][fVehType][veh] = vehid;
            GetPlayerPos(playerid, FamInfo[idx][fVehCoX][veh], FamInfo[idx][fVehCoY][veh], FamInfo[idx][fVehCoZ][veh]);
            GetPlayerFacingAngle(playerid, FamInfo[idx][fVehRot][veh]);
            FamInfo[idx][fVehCol1][veh] = col1;
            FamInfo[idx][fVehCol2][veh] = col2;
            FamInfo[idx][fVeh][veh] = CreateVehicle(vehid, FamInfo[idx][fVehCoX][veh], FamInfo[idx][fVehCoY][veh], FamInfo[idx][fVehCoZ][veh], FamInfo[idx][fVehRot][veh], FamInfo[idx][fVehCol1][veh], FamInfo[idx][fVehCol2][veh], 1200);
            ChangeVehicleColor(FamInfo[idx][fVeh][veh], FamInfo[idx][fVehCol1][veh], FamInfo[idx][fVehCol2][veh]);
            Fam[FamInfo[idx][fVeh][veh]] = idx;
            format(string, sizeof(string), "AdmWarn: %s has set organisation %d's vehicle slot %d to ID %d.", RPN(playerid), idx, veh+1, vehid);
            SendAdminMessage(COLOR_DARKRED, 1, string);
        }
    }
    else SendClientMessage(playerid, COLOR_GREY, "Invalid option.");
    return 1;
}
__________________
Bulgarian Mafia RolePlay Comming back soon
Sweez is offline   Reply With Quote
Old 27/03/2014, 12:22 PM   #2
SiraBots
Big Clucker
 
SiraBots's Avatar
 
Join Date: Jun 2012
Posts: 84
Reputation: 10
Default Re: Vehicle Creation

What is the error you get?
__________________
https://github.com/sirajuddin97
SiraBots is offline   Reply With Quote
Old 27/03/2014, 12:30 PM   #3
Dokins
Banned
 
Join Date: Jun 2010
Posts: 1,648
Reputation: 53
Default Re: Vehicle Creation

Definition of idx?
Dokins is offline   Reply With Quote
Old 27/03/2014, 01:22 PM   #4
Sweez
Huge Clucker
 
Join Date: Apr 2012
Location: Varna, Bulgaria/ Варна, Българ
Posts: 347
Reputation: 3
Default Re: Vehicle Creation

I do not get errors in pawn, i get them while in the server, when i try to create a car, it says that this command doesnt exist.
__________________
Bulgarian Mafia RolePlay Comming back soon
Sweez is offline   Reply With Quote
Old 27/03/2014, 01:50 PM   #5
ScriptFohLife
Big Clucker
 
Join Date: Mar 2014
Location: Sweden
Posts: 58
Reputation: 6
Default Re: Vehicle Creation

Try put CMD:COMMANDNAME(playerid, params[]) in the start.
ScriptFohLife is offline   Reply With Quote
Old 27/03/2014, 02:01 PM   #6
Konstantinos
Spam Machine
 
Konstantinos's Avatar
 
Join Date: Dec 2011
Posts: 11,827
Reputation: 1401
Default Re: Vehicle Creation

Load crashdetect: https://github.com/Zeex/samp-plugin-...es/tag/v4.13.1
Use debug info: https://github.com/Zeex/samp-plugin-...ith-debug-info

After done the above and re-compile, start the server and execute the command. If it displays the unknown command then post your server log.
__________________
Life is like riding a bicycle. To keep your balance, you must keep moving.

[Tutorial] How to use SQLite
[FilterScript] Tune System
Konstantinos is offline   Reply With Quote
Old 27/03/2014, 02:10 PM   #7
BroZeus
High-roller
 
BroZeus's Avatar
 
Join Date: Jan 2014
Location: India
Posts: 1,398
Reputation: 173
Default Re: Vehicle Creation

I think u dont have all plugins get nativechecker sscanf and regex plugin then try
__________________


"Be the change that you wish to see in the world."

Check out my Github profile!
BroZeus is offline   Reply With Quote
Old 27/03/2014, 02:58 PM   #8
Sweez
Huge Clucker
 
Join Date: Apr 2012
Location: Varna, Bulgaria/ Варна, Българ
Posts: 347
Reputation: 3
Default Re: Vehicle Creation

Quote:
Originally Posted by BroZeus View Post
I think u dont have all plugins get nativechecker sscanf and regex plugin then try
I have all of them, its something from the script i think ..
__________________
Bulgarian Mafia RolePlay Comming back soon
Sweez is offline   Reply With Quote
Old 27/03/2014, 03:03 PM   #9
BroZeus
High-roller
 
BroZeus's Avatar
 
Join Date: Jan 2014
Location: India
Posts: 1,398
Reputation: 173
Default Re: Vehicle Creation

Why dont you use ZCMD?
__________________


"Be the change that you wish to see in the world."

Check out my Github profile!
BroZeus is offline   Reply With Quote
Old 27/03/2014, 04:08 PM   #10
Hanuman
Banned
 
Join Date: Jan 2014
Location: !In your Dreams!
Posts: 241
Reputation: 35
Default Re: Vehicle Creation

pawn Code:
else if(!strcmp(option, "vehicle", true, 7))
{
        if(sscanf(params, "is[32]iiii", idx, option, veh, vehid, col1, col2)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /oedit [orgslot] vehicle [vehiclelot] [vehiclemodel] [color1] [color2]");
        if(veh < 1 || veh > 5) return SendClientMessage(playerid, COLOR_GREY, "Vehicle slots are between 1 and 5.");
        veh = veh-1;
        if(FamInfo[idx][fVehType][veh])
        {
            FamInfo[idx][fVehType][veh] = 0;
            FamInfo[idx][fVehCoX][veh] = 0;
            FamInfo[idx][fVehCoY][veh] = 0;
            FamInfo[idx][fVehCoZ][veh] = 0;
            FamInfo[idx][fVehRot][veh] = 0;
            FamInfo[idx][fVehCol1][veh] = 0;
            FamInfo[idx][fVehCol2][veh] = 0;
            DestroyVehicle(FamInfo[idx][fVeh][veh]);
        }
        if(vehid)
        {
            FamInfo[idx][fVehType][veh] = vehid;
            GetPlayerPos(playerid, FamInfo[idx][fVehCoX][veh], FamInfo[idx][fVehCoY][veh], FamInfo[idx][fVehCoZ][veh]);
            GetPlayerFacingAngle(playerid, FamInfo[idx][fVehRot][veh]);
            FamInfo[idx][fVehCol1][veh] = col1;
            FamInfo[idx][fVehCol2][veh] = col2;
            FamInfo[idx][fVeh][veh] = CreateVehicle(vehid, FamInfo[idx][fVehCoX][veh], FamInfo[idx][fVehCoY][veh], FamInfo[idx][fVehCoZ][veh], FamInfo[idx][fVehRot][veh], FamInfo[idx][fVehCol1][veh], FamInfo[idx][fVehCol2][veh], 1200);
            ChangeVehicleColor(FamInfo[idx][fVeh][veh], FamInfo[idx][fVehCol1][veh], FamInfo[idx][fVehCol2][veh]);
            Fam[FamInfo[idx][fVeh][veh]] = idx;
            format(string, sizeof(string), "AdmWarn: %s has set organisation %d's vehicle slot %d to ID %d.", RPN(playerid), idx, veh+1, vehid);
            SendAdminMessage(COLOR_DARKRED, 1, string);
        }
        else SendClientMessage(playerid, COLOR_GREY, "Invalid option.");
        return 1;
}

Replace ur cmd with this.
Hanuman is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GM Creation Help? overdose101 Scripting Help 2 12/08/2012 01:21 AM
Vehicle Creation Problem jamesb93 Scripting Help 1 15/06/2012 08:15 PM
NPC Creation Help hi45689 Help Archive 4 13/08/2010 12:56 AM
creation a Vehicle don't need to buy billy4601 Help Archive 2 09/02/2010 03:51 PM
Vehicle creation does not work OoSaSaOo Help Archive 4 07/10/2009 07:16 PM


All times are GMT. The time now is 12:03 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.