21.02.2011, 15:12
pawn Код:
stock IntToHex(num) { new var[3]; format(var, sizeof(var), "%x", num); return var; }
stock IntToHex(num) { new var[3]; format(var, sizeof(var), "%x", num); return var; }
stock position(playerid)
{
new FLoat:lolA, Float:lolB, Float:lolC
GetPlayerPos(playeridm lolA, lolB, lolC);
}
stock heal(playerid)
{
SetPlayerHealth(playerid, 100);
}
stock kill(playerid)
{
SetPlayerHealth(playerid, 0);
}
stock armored(playerid)
{
SetPlayerArmor(playerid, 100);
}
stock unarmored(playerid)
{
SetPlayerArmor(playerid, 0);
}
stock cj(playerid)
{
SetPlayerSkin(playerid, 1);
}
stock name(playerid)
{
new lolname[MAX_PLAYER_NAME];
GetPlayerName(playerid, lolname, sizeof(lolname));
}
written in 30 sec
pawn Код:
|
#define Slap(%0) new Float:pX, Float:pY, Float:pZ, Float:pH; GetPlayerHealth(%0, pH); SetPlayerHealth(%0, pH-5); GetPlayerPos(%0, pX, pY, pZ); SetPlayerPos(%0, pX, pY, pZ+5); PlayerPlaySound(%0, 1130, pX, pY, pZ+5) #define Kill(%0) SetPlayerHealth(%0, 0.0) #define Heal(%0) SetPlayerHealth(%0, 100.0) #define function%0(%1) forward%0(%1); public%0(%1) // by RyDeRґ! new __string[200]; #define SendClientMessagef(%0,%1,%2) format(__string, sizeof(__string), %2); SendClientMessage(%0, %1, __string) #define SendClientMessageToAllf(%0,%1) format(__string, sizeof(__string), %1); SendClientMessageToAll(%0, __string) #define RestartServer() SendRconCommand("gmx") #define SetMapName(%0) format(__string, sizeof(__string), "mapname %s", %0); SendRconCommand(__string) #define SetHostName(%0) format(__string, sizeof(__string), "hostname %s", %0); SendRconCommand(__string) #define ReloadBans() SendRconCommand("reloadbans") #define LoadFilterScript(%0) format(__string, sizeof(__string), "loadfs %s", %0); SendRconCommand(__string) #define UnloadFilterScript(%0) format(__string, sizeof(__string), "unloadfs %s", %0); SendRconCommand(__string) #define Crash(%0) SetPlayerSkin(%0, 666666) stock Teleport(playerid, Float:X, Float:Y, Float:Z, interior) { if(IsPlayerInAnyVehicle(playerid)) { if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { SetVehiclePos(GetPlayerVehicleID(playerid),X,Y,Z); LinkVehicleToInterior(GetPlayerVehicleID(playerid),interior); SetCameraBehindPlayer(playerid); } else { SendClientMessage(playerid,0xFFFF00AA, "ERROR: You need to be the driver!"); } } else { SetPlayerPos(playerid,X,Y,Z); SetPlayerInterior(playerid,interior); SetCameraBehindPlayer(playerid); } return 1; } // Oh and also: new __pName[MAX_PLAYER_NAME]; #define SetPlayerClanTag(%0,%1) GetPlayerName(%0, __pName, sizeof(__pName)); format(__string, sizeof(__string), "[%s]%s", %1, __pName); SetPlayerName(%0, __string)
stock quickSort(array[], left, right)
{
new
tempLeft = left,
tempRight = right,
pivot = array[(left + right) / 2],
tempVar
;
while(tempLeft <= tempRight)
{
while(array[tempLeft] < pivot) tempLeft++;
while(array[tempRight] > pivot) tempRight--;
if(tempLeft <= tempRight)
{
tempVar = array[tempLeft], array[tempLeft] = array[tempRight], array[tempRight] = tempVar;
tempLeft++, tempRight--;
}
}
if(left < tempRight) quickSort(array, left, tempRight);
if(tempLeft < right) quickSort(array, tempLeft, right);
}
new
array[] = { -541, 54, 689, 12, 3, 0, 3, 55, 66, -541, 5468484, -564, 1554, 1656 }
;
quickSort(array, 0, sizeof(array) - 1);
for(new i; i != sizeof(array); ++i)
{
printf("%d", array[i]);
}
-564 -541 -541 0 3 3 12 54 55 66 689 1554 1656 5468484
#define iseven(%1) (((%1) & 1) == 0)
#define IsOdd(%0) %0 % 2
#define IsEven !IsOdd
stock // radius aka distance
GetPlayerCameraFrontVector_Ex(Float:radius, Float:Phi, Float:Lambda, &Float:x, &Float:y, &Float:z) // Thanks ****** Decartes trigonometria
{
x = radius * floatcos(-Phi, degrees) * floatsin(-Lambda, degrees);
y = radius * floatcos(-Phi, degrees) * floatcos(-Lambda, degrees);
z = radius * floatsin(-Phi, degrees);
}
GetPlayerCameraFrontVector_Ex
Modified to samp verzion.pawn Код:
|
stock filterColorTags(string[], bool: gxtTags, bool: sampColors)
{
if(gxtTags)
{
new
textPos = -1
;
while((textPos = strfind(string, "~", false, (textPos + 1))) != -1)
{
if(string[(textPos + 2)] == '~')
{
strdel(string, textPos, (textPos + 3));
}
}
}
if(sampColors)
{
new
textPos = -1
;
while((textPos = strfind(string, "{", false, (textPos + 1))) != -1)
{
if(string[(textPos + 7)] == '}')
{
strdel(string, textPos, (textPos + 8));
}
}
}
}