SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 05/02/2013, 10:40 PM   #1
Vytixz
Big Clucker
 
Join Date: Jan 2013
Posts: 55
Reputation: 0
Default /car command to spawn Infernus

dfadasdasdasdas

Last edited by Vytixz; 14/03/2016 at 11:09 PM.
Vytixz is offline   Reply With Quote
Old 05/02/2013, 10:41 PM   #2
zde5
Little Clucker
 
Join Date: Jul 2009
Location: Croatia
Posts: 48
Reputation: 4
Default Re: /car command to spawn Infernus

http://forum.sa-mp.com/showthread.php?t=413556
zde5 is offline   Reply With Quote
Old 06/02/2013, 01:48 AM   #3
AphexCCFC
Huge Clucker
 
AphexCCFC's Avatar
 
Join Date: Dec 2012
Posts: 447
Reputation: 23
Default Re: /car command to spawn Infernus

pawn Code:
CMD:car(playerid, params[])
{
    new Float:pos[4];
    GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
    GetPlayerFacingAngle(playerid, pos[3]);
    CreateVehicle(411, pos[0], pos[1], pos[2], pos[3], 1, 1, 1200);
    PutPlayerInVehicle(playerid, 411, 0);
}
__________________
Domination Roleplay is currently under development for the next couple of months.
AphexCCFC is offline   Reply With Quote
Old 06/02/2013, 03:00 AM   #4
mrtms
Big Clucker
 
Join Date: Jul 2012
Location: WA
Posts: 97
Reputation: 9
Default Re: /car command to spawn Infernus

To add the optional part:

SendClientMessage(playerid, COLOR_GREEN, "Message here.");
mrtms is offline   Reply With Quote
Old 06/02/2013, 05:16 AM   #5
RajatPawar
High-roller
 
RajatPawar's Avatar
 
Join Date: Aug 2011
Location: ヽ༼ຈل͜ຈ༽ノ
Posts: 2,177
Reputation: 311
Default Re: /car command to spawn Infernus

Quote:
Originally Posted by AphexCCFC View Post
pawn Code:
CMD:car(playerid, params[])
{
    new Float:pos[4];
    GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
    GetPlayerFacingAngle(playerid, pos[3]);
    CreateVehicle(411, pos[0], pos[1], pos[2], pos[3], 1, 1, 1200);
    PutPlayerInVehicle(playerid, 411, 0);
}
I think this is a bit wrong, it could put you in any infernus across the server. Also, params[] is not needed.
Therefore,
pawn Code:
CMD:car(playerid)
{
    new Float:pos[4];
    GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
    GetPlayerFacingAngle(playerid, pos[3]);
    new vehicle = CreateVehicle(411, pos[0], pos[1], pos[2], pos[3], 1, 1, 1200);
    PutPlayerInVehicle(playerid, vehicle, 0);
        SendClientMessage(playerid, -1, "Your infernus has been spawned.");
}
RajatPawar is offline   Reply With Quote
Old 06/02/2013, 12:19 PM   #6
AphexCCFC
Huge Clucker
 
AphexCCFC's Avatar
 
Join Date: Dec 2012
Posts: 447
Reputation: 23
Default Re: /car command to spawn Infernus

Quote:
Originally Posted by Rajat_Pawar View Post
I think this is a bit wrong, it could put you in any infernus across the server. Also, params[] is not needed.
Therefore,
pawn Code:
CMD:car(playerid)
{
    new Float:pos[4];
    GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
    GetPlayerFacingAngle(playerid, pos[3]);
    new vehicle = CreateVehicle(411, pos[0], pos[1], pos[2], pos[3], 1, 1, 1200);
    PutPlayerInVehicle(playerid, vehicle, 0);
        SendClientMessage(playerid, -1, "Your infernus has been spawned.");
}
Oh yeah, thanks for correcting
__________________
Domination Roleplay is currently under development for the next couple of months.
AphexCCFC is offline   Reply With Quote
Old 06/02/2013, 12:43 PM   #7
[WA]iRonan
Huge Clucker
 
Join Date: May 2012
Location: A box in the sea
Posts: 442
Reputation: 101
Default Re: /car command to spawn Infernus

Seems somebody asked my question. Thaanks :3
__________________



Save Our Souls - A SAMP Survival Server - 151.236.29.108:7960
[WA]iRonan is offline   Reply With Quote
Old 06/02/2013, 11:57 PM   #8
Vytixz
Big Clucker
 
Join Date: Jan 2013
Posts: 55
Reputation: 0
Default Re: /car command to spawn Infernus

dasdsdaddsasd

Last edited by Vytixz; 14/03/2016 at 11:09 PM.
Vytixz is offline   Reply With Quote
Old 07/02/2013, 12:00 AM   #9
AphexCCFC
Huge Clucker
 
AphexCCFC's Avatar
 
Join Date: Dec 2012
Posts: 447
Reputation: 23
Default Re: /car command to spawn Infernus

Under:

pawn Code:
SendClientMessage(playerid, -1, "Your infernus has been spawned.");

Put:

pawn Code:
return 1;
__________________
Domination Roleplay is currently under development for the next couple of months.
AphexCCFC 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
Spawn command DerickClark Scripting Help 3 31/01/2013 12:55 AM
[HELP]Spawn car command [Aka]Dragonu Scripting Help 7 01/09/2011 12:41 PM
Car spawn command Osviux Help Archive 2 21/11/2010 10:46 AM
spawn car/nrg on command jamesbond007 Help Archive 3 17/02/2010 11:39 AM


All times are GMT. The time now is 04:10 AM.


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