Vehicle Spawn
#1

I was wondering if anyone knew the /veh command is? - This is for my new big project called Millenium Roleplay!!!



If you wish to help on Millenium Roleplay contact me on skype - e.r.r.y!!
Reply
#2

Here is the "skeleton" or layout of the command:

pawn Код:
// Somewhere in the millenium code
new gVehStoreVal[MAX_PLAYERS];

// OnPlayerConnect
gVehStoreVal[playerid] = INVALID_VEHICLE_ID;

OnPlayerCommandText(...)
{
   if(strcmp(cmdtext, "/veh") == 0)
   {
      if(gVehStoreVal[playerid] == INVALID_VEHICLE_ID)
      {
          // Grab params here.
          // https://sampwiki.blast.hk/wiki/Creating_Commands

          // Create a vehicle after all params are okay
          // https://sampwiki.blast.hk/wiki/AddStaticVehicleEx
      }
      else
      {
          // Vehicle already created, notify player!
      }
   }
}
And you can use gVehStoreVal[<integer>]; on /destroyveh.
Or you can even create it without them.

https://sampwiki.blast.hk/wiki/Creating_Commands
https://sampwiki.blast.hk/wiki/AddStaticVehicleEx

If you're going to build a full gamemode, I suggest you firstly learn the basics.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)