Command to spawn cars
#1

Hi.

How do i make a command so everybody on my server can spawn a car like this
/spawncar ID

So if you type
/spawncar 522
I will spawn a NRG?
Reply
#2

Search for debug.
Reply
#3

Quote:
Originally Posted by иєσz
Search for debug.
Im a new one to scripting and wanna make this. I havent make anything on it yet so ?
Reply
#4

http://forum.sa-mp.com/index.php?topic=19488.0

Add that filterscript, go in game, log into rcon and type /v <model id>.
Reply
#5

KennethHoegh if you're new to scripting, this is kinda throwing yourself in the deep end. Start with some simple commands that give back non variable responses, and work your way up.

eg. /car - gives you an Infernus

as opposed to: /car ID - considerably more complicated for a beginner.
Reply
#6

Quote:
Originally Posted by Weirdosport
KennethHoegh if you're new to scripting, this is kinda throwing yourself in the deep end. Start with some simple commands that give back non variable responses, and work your way up.

eg. /car - gives you an Infernus

as opposed to: /car ID - considerably more complicated for a beginner.
Sure - But im also looking for someone to teach me the "basic" commands (as you sar /car gives you an Infernus.) But i cant find any. :/
Reply
#7

Search for car spawner and take the first result lol.. Only remove the admin check
Reply
#8

Quote:
Originally Posted by KennethHoegh
Sure - But im also looking for someone to teach me the "basic" commands (as you sar /car gives you an Infernus.) But i cant find any. :/
pawn Код:
if (!strcmp (cmdtext,"/infernus", true))
    {
        if(IsPlayerAdmin(playerid)) //Is the player rcon admin?
        {
            if(!IsPlayerInAnyVehicle(playerid) //the "!" means that if "IsPlayerInVehicle" returns false, the code will execute, if not, the return code will.
            {
                //car spawn code, ironicly this is the only thing i don't know :D lol :< maybe someone else can fill it in
            }
            return SendClientMessage(playerid,0xFF0000FF,"You are already in a vehicle!"); //If the player already is in a vehicle, this will happen
        }
        return SendClientMessage(playerid,0xFF0000FF,"Access denied!"); //If the player wasn't logged in to rcon, this happens.
    }
i'm not a pawn king, but i know some :P

just correct me if i did something wrong

I also wrote it directly on the forum.
Reply
#9

pawn Код:
if (!strcmp (cmdtext,"/infernus", true))
    {
        if(IsPlayerAdmin(playerid)) //Is the player rcon admin?
        {
            if(!IsPlayerInAnyVehicle(playerid) //the "!" means that if "IsPlayerInVehicle" returns false, the code will execute, if not, the return code will.
            {
                GetPlayerPos(playerid, Float:X, Float:Y, Float:Z);
                GetPlayerFacingAngle(playerid, Float:Angle);
                CreateVehicle(411, X, Y, Z + 2.0, Angle + 90.0, -1, -1, 5000);
            }
            return SendClientMessage(playerid,0xFF0000FF,"You are already in a vehicle!"); //If the player already is in a vehicle, this will happen
        }
        return SendClientMessage(playerid,0xFF0000FF,"Access denied!"); //If the player wasn't logged in to rcon, this happens.
    }
That Should Work But Im Not Going To Test It.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)