[FUNC] Usefull Commands <- Fixed -
CJ101 - 16.05.2009
Commands Added:
Код:
RandomVehColor(playerid), ResetAllPlayerWeapons(), RandomMessage(), ResetAllPlayerMoney(),
KillAllPlayers(), GiveAllArmour(), ForceAllToClassSelection(), RemoveAllFromVehicle(),
IsPlayerOnFoot(playerid), IsPlayerInBannedVehicle(playerid), PlaySoundForAll(SoundID),
BringAllToPlace(Float:X,Float:Y,Float:Z), SpawnAllPlayers(), IsValidColorID(ColorID), SetAllColor(ColorID), SetAllPlayersCash(Amount), SetAllScores(Score), Explode(playerid),
ExplodeAll(), GiveAllPlayerWeapon(WeaponID,Ammo), HealAllPlayersCars(), HealAllPlayers(),
DestroyAllPlayerVehicles(), GiveCashToAll(),
New
SendMessageToAdmins(Color,String), SendMessageToVehicles(Color,String), SendMessageToPlayerSkins(Color, String)
Instructions:
Just copy the File to /pawno/includes and add
to your gamemodes
Updated
Код:
I Took the time to fix everything in this, and added a few more functions.
Not really a update, but a fix.
Dowload Here:
http://www.megaupload.com/?d=OJNFM2KX
Re: [PLUGIN] Usefull Commands - Double-O-Seven - 16.05.2009
It's not a plugin, it's not commands, it's functions and it's written "Useful", not "Usefull"
Re: [PLUGIN] Usefull Commands -
Slice - 16.05.2009
Like he said ^^^^^^^^^^^^ and also..
Код:
#include <core>
#include <float>
#include <string>
#include <file>
#include <time>
#include <datagram>
#include <a_players>
#include <a_vehicles>
#include <a_objects>
#include <a_sampdb>
#include <a_samp>
#include <core>
#include <float>
Wtf?
Код:
public RandomVehColor(playerid)
{
new rcolor = random(100);
ChangeVehicleColor(playerid,rcolor,rcolor);
return 1;
}
There are more than 100 colors you know
Код:
if(GetPlayerState(playerid) == 1)
What is 1? What if PLAYER_STATE_ONFOOT changes to something else in the next version? The constants are there for a reason, use them.
Код:
public IsPlayerInBannedVehicle(playerid)
{
new veh = GetVehicleModel(GetPlayerVehicleID(playerid));
if (veh == 520 || veh == 525)
{
return true;
}
else
{
return false;
}
}
What's wrong with the towtruck and the hydra now?
Код:
public PlaySoundForAll(SoundID)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
PlayerPlaySound(i,SoundID,0,0,0);
}
return 1;
}
I don't think all the disconnected players can hear the sounds.
Код:
public IsValidColorID(ColorID)
{
if(ColorID > 126)
{
return false;
}
else
{
return true;
}
}
See
this wiki entry for a list of working colors.
Код:
public GiveAllPlayersCash(Amount)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
ResetPlayerMoney(i);
GivePlayerMoney(i,Amount);
}
return 1;
}
You mean SetAllPlayersCash? Same with disconnected players here too. You could make it go to GetMaxPlayers() instead.
These flaws just goes on and on and on in the code.
And the indentation.. what indentation? : x
Re: [PLUGIN] Usefull Commands -
CJ101 - 16.05.2009
hey, this is my first time making one of these... ill fix it sooner or later in a in version.
Re: [FUNC] Usefull Commands <- Fixed -
Weirdosport - 17.05.2009
I've heard from a top-gun scripter than GetMaxPlayers() is more inefficient than MAX_PLAYERS despite the fact it should theoretically loop less, and it can't be saved to a variable..