23.03.2010, 19:29
Quote:
Originally Posted by [ĦŁ₣
ЉǾǖŦĦЗŁΛẄ ]
No you need to use the variable defined in the loop: for(new b = 0; b < sizeof(BlackSkins); b ++){ if(BlackSkins[b] == skinid) return 1; } |
Originally Posted by [ĦŁ₣
ЉǾǖŦĦЗŁΛẄ ]
No you need to use the variable defined in the loop: for(new b = 0; b < sizeof(BlackSkins); b ++){ if(BlackSkins[b] == skinid) return 1; } |
Originally Posted by Carlton
Quote:
|
Originally Posted by Donny
Quote:
|
stock bool:IsAnyPlayerInVehicle(vehicleid)
{
new
v_end = GetMaxPlayers(),
i;
for(i = 0; i < v_end; i++) if(IsPlayerConnected(i) && GetPlayerVehicleID(i) == vehicleid) break;
return i < v_end;
}
Originally Posted by Gamestar.
pawn Код:
|
Originally Posted by Carlton
Quote:
|
new Float: Ammunation_Coordinates[][3] = {
{ 286.148986,-40.644397,1001.515625 },
{ 286.800994,-82.547599,1001.515625 },
{ 296.919982,-108.071998,1001.515625 },
{ 314.820983,-141.431991,999.601562 },
{ 316.524993,-167.706985,999.593750 }
};
stock IsPlayerInAmmunation(playerid) {
for(new i = 0; i < sizeof(Ammunation_Coordinates); i++) {
if(IsPlayerInRangeOfPoint(playerid, 70.0, Ammunation_Coordinates[i][0], Ammunation_Coordinates[i][1], Ammunation_Coordinates[i][2])) return 1;
}
return 0;
}
if(IsPlayerInAmmunation(playerid)) {
printf("Id %d is in a Ammunation", playerid);
}
stock VehicleLights(vehicleid, bool:status) // By Norn
{
new panels, doors, lights, tires;
GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
if(status == true) lights = encode_lights(1, 1, 1, 1); else lights = encode_lights(0, 0, 0, 0);
UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, tires);
return 1;
}
stock encode_lights(light1, light2, light3, light4) {
return light1 | (light2 << 1) | (light3 << 2) | (light4 << 3);
}
VehicleLights(vehicleid, true);
VehicleLights(vehicleid, false);
stock IsPlayerInClothesStore(playerid) {
new Float: Clothes_Stores[][3] = {
{ 207.737991,-109.019996,1005.132812 },
{ 204.332992,-166.694992,1000.523437 },
{ 207.054992,-138.804992,1003.507812 },
{ 203.777999,-48.492397,1001.804687 },
{ 226.293991,-7.431529,1002.210937 },
{ 161.391006,-93.159156,1001.804687 }
}
for(new cs = 0; cs < sizeof(Clothes_Stores); cs++) {
if(IsPlayerInRangeOfPoint(playerid, 70.0, Clothes_Stores[cs][0], Clothes_Stores[cs][1], Clothes_Stores[cs][2])) return 1;
}
return 0;
}
stock IsPlayerInGym(playerid) {
new Float: Gyms[][3] = {
{ 772.111999,-3.898649,1000.728820 },
{ 774.213989,-48.924297,1000.585937 },
{ 773.579956,-77.096694,1000.655029 }
}
for(new gy = 0; gy < sizeof(Gyms); gy ++) {
if(IsPlayerInRangeOfPoint(playerid, 70.0, Gyms[gy][0], Gyms[gy][1], Gyms[gy][2])) return 1;
}
return 0;
}
stock IsPlayerInAShop(playerid) { // 24-7
new Float: Shops[][3] = {
{ -25.884498,-185.868988,1003.546875 },
{ 6.091179,-29.271898,1003.549438 },
{ -30.946699,-89.609596,1003.546875 },
{ -25.132598,-139.066986,1003.546875 },
{ -27.312299,-29.277599,1003.557250 },
{ -26.691598,-55.714897,1003.546875 }
}
for(new s = 0; s < sizeof(Shops); s++ ) {
if(IsPlayerInRangeOfPoint(playerid, 70.0, Shops[0], Shops[1], Shops[2])) return 1;
}
return 0;
}
Originally Posted by » RyDeR «
Quote:
pawn Код:
|
stock TestGetWeaponName()
{
new
Weapon_Name[32];
print(" ");
for(new i; i != 46; i++)
{
GetWeaponName(i, Weapon_Name, sizeof Weapon_Name);
printf("weaponid: %d | %s", i, Weapon_Name);
}
print(" ");
}
[22:01:03] weaponid: 0 | [22:01:03] weaponid: 1 | Brass Knuckles [22:01:03] weaponid: 2 | Golf Club [22:01:03] weaponid: 3 | Nite Stick [22:01:03] weaponid: 4 | Knife [22:01:03] weaponid: 5 | Baseball Bat [22:01:03] weaponid: 6 | Shovel [22:01:03] weaponid: 7 | Pool Cue [22:01:03] weaponid: 8 | Katana [22:01:03] weaponid: 9 | Chainsaw [22:01:03] weaponid: 10 | Dildo [22:01:03] weaponid: 11 | Dildo [22:01:03] weaponid: 12 | Vibrator [22:01:03] weaponid: 13 | Vibrator [22:01:03] weaponid: 14 | Flowers [22:01:03] weaponid: 15 | Cane [22:01:03] weaponid: 16 | Grenade [22:01:03] weaponid: 17 | Teargas [22:01:03] weaponid: 18 | [22:01:03] weaponid: 19 | [22:01:03] weaponid: 20 | [22:01:03] weaponid: 21 | [22:01:03] weaponid: 22 | Colt 45 [22:01:03] weaponid: 23 | Silenced Pistol [22:01:03] weaponid: 24 | Desert Eagle [22:01:03] weaponid: 25 | Shotgun [22:01:03] weaponid: 26 | Sawn-off Shotgun [22:01:03] weaponid: 27 | Combat Shotgun [22:01:03] weaponid: 28 | UZI [22:01:03] weaponid: 29 | MP5 [22:01:03] weaponid: 30 | AK47 [22:01:03] weaponid: 31 | M4 [22:01:03] weaponid: 32 | TEC9 [22:01:03] weaponid: 33 | Rifle [22:01:03] weaponid: 34 | Sniper Rifle [22:01:03] weaponid: 35 | Rocket Launcher [22:01:03] weaponid: 36 | Heat Seaker [22:01:03] weaponid: 37 | Flamethrower [22:01:03] weaponid: 38 | Minigun [22:01:03] weaponid: 39 | Satchel Explosives [22:01:03] weaponid: 40 | Bomb [22:01:03] weaponid: 41 | Spray Can [22:01:03] weaponid: 42 | Fire Extinguisher [22:01:03] weaponid: 43 | Camera [22:01:03] weaponid: 44 | [22:01:03] weaponid: 45 |
if (GetWeaponIDByName("Katana"))
{
//correct name
}
Originally Posted by dice7
Or better yet returning 0, so you can just do
pawn Код:
|
RemovePlayerWeapon ( playerid, weaponid )
{
new
w [ 13 ],
a [ 13 ];
for ( new slot; slot < 13; slot++ )
GetPlayerWeaponData ( playerid, slot, w [ slot ], a [ slot ] );
ResetPlayerWeapons ( playerid );
for ( new wep; wep < 13; wep++ )
{
if ( w [ wep ] == weaponid )
continue;
GivePlayerWeapon ( playerid, w [ wep ], a [ wep ] );
}
}
pawn Код:
|
RemovePlayerWeapon ( playerid, weaponid ) {
new
wd[2][13],
cloop;
for (cloop = 0; cloop < 13; cloop++ ) {
GetPlayerWeaponData ( playerid, cloop, wd[0][cloop], wd[1][cloop] );
}
ResetPlayerWeapons ( playerid );
for(cloop = 0; cloop < 13; cloop ++ ) {
if(wd[0][cloop] == weaponid) continue;
GivePlayerWeapon ( playerid, wd[0][cloop], wd[1][cloop]);
}
}
stock ChangeTextDrawColorForAll(Text:txtid, color) {
TextDrawHideForAll(txtid);
TextDrawColor(txtid,color);
TextDrawShowForAll(txtid);
}
stock ChangeTextDrawColorForPlayer(playerid, Text:txtid, color) {
TextDrawHideForPlayer(playerid, txtid);
TextDrawColor(txtid,color);
TextDrawShowForPlayer(playerid, txtid);
}
pawn Код:
pawn Код:
|
CreatePrivateVehicle RemovePrivateVehicle PrivateVehicleForTeam UnPrivateVehicleForTeam |
new Text:Blind;
new PlayerIsBlind[MAX_PLAYERS]; >> OnPlayerConnect should be set to 0
forward CreateTextDrawForAll(); >> put it in OnGameModeInit();
forward SetPlayerBlind(playerid,toggle);
public CreateTextDrawForAll()
{
Blind = TextDrawCreate(0.0,0.0,"00000"); //For /blind cmd
TextDrawUseBox(Blind,1);
TextDrawBoxColor(Blind,0x000000FF);
TextDrawTextSize(Blind,950,950);
TextDrawFont(Blind,3);
TextDrawLetterSize(Blind,5,100);
TextDrawColor(Blind,0x000000FF);
}
public SetPlayerBlind(playerid,toggle)
{
if(toggle == 1)
{
TextDrawShowForPlayer(playerid,Blind);
PlayerIsBlind[playerid] = 1;
}
else if (toggle == 0)
{
TextDrawHideForPlayer(playerid,Blind);
PlayerIsBlind[playerid] = 0;
}
}
if(strcmp(cmd, "/blind", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pAdmin] >= 1)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /blind [playerid/PartOfName]");
return 1;
}
new playa;
playa = ReturnUser(tmp);
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(PlayerIsBlind[playa])
{
SetPlayerBlind(playa,0);
format(string, sizeof(string), "AdmCmd: %s is Unblinded by %s",giveplayer ,sendername);
SendClientMessage(playa,COLOR_LIGHTBLUE,"* You can now see, you was unblinded by Admin.");
}
else
{
SetPlayerBlind(playa,1);
SendClientMessage(playa,COLOR_LIGHTBLUE,"* You are now blind, you was blinded by Admin.");
format(string, sizeof(string), "AdmCmd: %s is Blinded by %s",giveplayer ,sendername);
}
SendMessageToAdmin(COLOR_LIGHTRED,string,1);
}
}
}
else
{
SendFalseText(playerid,"You cannot use this command.");
}
}
return 1;
}