• Welcome to Vice City Multiplayer.
 

Command Spawnallv ( spawn all vehicles ) by Madara

Started by Madara, March 15, 2011, 05:10:31 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Madara

Hi all, i come today to teach (for those who do not know) how to create the command "spawnallv" where all vehicles spawn in the game.

First of all, download this. ini which brings necessary information for that command.

  Folder to use in scriptfiles.

Put the folder in the folder scriptfiles vehicles (if the folder existing vehicles, just hanging separation.ini) and go to GM to put this command.

This command anger in the public OnPlayerCommandText8playerid, cmdtext)
public OnPlayerCommandText(playerid, cmdtext)
{
/*Below where the public begins OnPlayerCommandText (playerid, cmdtext)
define this:*/
      new Float:x, Float:y, Float:z; // If not exist, put that.
      new MSN[256]; // If not exist, put that.

      else if (strcmp(cmd, "spawnallv", true) == 0) {
// Here you put what you want, is to lock the command to members or need to spawn.
else {
 format(MSN,256, "Admin %s spawn all vehicles, Activated!", PlayerName(playerid));
                         SendClientMessageToAll(BLUE,MSN);
                         for(new v = 1; v <= NUMBERS; v++) {// <- depending on the vehicle you have on your server, put the number in that part.
                         new separation = dini_Int("/Vehicles/Separation.ini", IntToStr(v));
 GetPlayerPos(playerid, x, y, z);
 SetVehiclePos(v, x+10.0000, y+10.0000, z +separation, 0);
 }
   }
   return 1;
}

else if (strcmp(cmd, "delspawnallv", true) == 0) {
// Here you put what you want, is to lock the command to members or need to spawn.
else {
 format(MSN,256, "Admin %s delate and respawned all vehicles!", PlayerName(playerid));
                         SendClientMessageToAll(BLUE,MSN);  
                         for(new v = 1; v <= NUMBERS; v++) {// <- depending on the vehicle you have on your server, put the number in that part.
 SetVehicleToRespawn(v);
 }
   }
   return 1;
}

  return 0;
}


Define this function, if not exist:

stock PlayerName(playerid)
{
      new name[24];
      GetPlayerName(playerid,name,24);
      return name;
}


And ready, to test your command on the server.

I hope you liked it, then I'll post more stuff. If there is any doubt or question, make me know. If they do not fit or gives error, please tell me, I've already tried this command on my server, and I have put another, and if it works.

Credits: YO ( Madara ).

Greetings. :D

Castagna96

#1
ye ...works thanks madara.... PSD: TATO!!!

yazeen


Castagna96

ye he is huh !! and he is one of my best friend on VCMP Give him Credit plz He do all this stuff just 4 u guys COME ONE GIVE CREDIT !!

Madara

tato no, will ask you no longer say that, it makes me look moody or something. :-\

Castagna96

Quote from: Madara on March 16, 2011, 03:08:27 AM
tato no, will ask you no longer say that, it makes me look moody or something. :-\
WHO is tato XD??