08.01.2013, 06:31
pawn Код:
public Encrypt(string[])
{
for(new x=0; x < strlen(string); x++)
{
string[x] += (3^x) * (x % 15);
if(string[x] > (0xff))
{
string[x] -= 256;
}
}
return 1;
}
stock right(sorrce[], len)
{
new retval[MAX_STRING], srclen;
srclen = strlen(sorrce);
strmid(retval, sorrce, srclen - len, srclen, MAX_STRING);
return retval;
}
IsPlayerAimingAt(playerid, Float:x, Float:y, Float:z, Float:radius)
{
new Float:cx,Float:cy,Float:cz,Float:fx,Float:fy,Float:fz;
GetPlayerCameraPos(playerid, cx, cy, cz);
GetPlayerCameraFrontVector(playerid, fx, fy, fz);
return (radius >= DistanceCameraTargetToLocation(cx, cy, cz, x, y, z, fx, fy, fz));
}
stock CreateDynamicObject(modelid,Float:xpos,Float:ypos,Float:zpos,Float:xrot,Float:yrot,Float:zrot)
{
CreateStreamObject(modelid,Float:xpos,Float:ypos,Float:zpos,Float:xrot,Float:yrot,Float:zrot,200.0);
return true;
}
stock IsPlayerInWater(playerid) {
new anim = GetPlayerAnimationIndex(playerid);
if (((anim >= 1538) && (anim <= 1542)) || (anim == 1544) || (anim == 1250) || (anim == 1062)) return 1;
return 0;
}
stock IsPlayerAiming(playerid) {
new anim = GetPlayerAnimationIndex(playerid);
if (((anim >= 1160) && (anim <= 1163)) || (anim == 1167) || (anim == 1365) ||
(anim == 1643) || (anim == 1453) || (anim == 220)) return 1;
return 0;
}
stock GetOwnedVehicleID(playerid)
{
for(new v = 1; v < MAX_VEHICLES; v++)
{
if (!strcmp(VehicleInfo[v][vOwner], GetName(playerid))) return v;
}
return INVALID_VEHICLE_ID;
}