Re: General Reference -
Kar - 07.07.2012
In vehicle Mouse Wheel Detection
pawn Код:
#define KEY_MOUSE_SCROLL_CLICK (320) // VEHICLE ONLY
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys == 320)
{
SendClientMessage(playerid, -1, "Mouse-click.");
}
return 1;
}
KEY_CTRL_BACK is used to detect mouse wheel scrolling backwards in vehicle
Re: General Reference -
detter - 21.08.2012
Need time machine to go few hours back!
my whole RP mode ( i was still working on it) with 6k+ lines disapired
DAMN!!!!
days of scripting ,designing ,mapping :/
is there way to convert .amx to .pwn
Re: General Reference -
Virus. - 28.10.2012
What are TextDraws supposed to do and how to use them? Thanks.
Re: General Reference -
Lordzy - 28.10.2012
Quote:
Originally Posted by Virus.
What are TextDraws supposed to do and how to use them? Thanks.
|
TextDraws are kind of texts or designs which are displayed on the screen. There are 2 kind of textdraws.
1)Normal Textdraw just like Gametext.
2)Clickable textdraw.
In clickable textdraw, we can create some kind of responses when a player clicks the textdraw. Just like the button response of a Dialog. Here are some pics:
Here those texts such as "You are kicked from the server" and "Exceeded 15 minutes" are textdraws which is being displayed.
PS:They aren't clickable.
Those are created by me on L-AFK system to show that when a player goes on AFK. I hope you understood about textdraws.
Re: General Reference -
Virus. - 28.10.2012
Do we need to click something for Clickable textdraw?
Re: General Reference -
Y_Less - 28.10.2012
Yes, the text draw!
Re: General Reference -
[KHK]Khalid - 09.11.2012
This is a quick guide to textdraws. Also see
this for clickable ones.
Re: General Reference -
Virus. - 19.11.2012
Hello guys I want to make a speedometer. I have searched the forum, but I get only text speedometers.
Re: General Reference -
Y_Less - 19.11.2012
Quote:
Originally Posted by Virus.
Hello guys I want to make a speedometer. I have searched the forum, but I get only text speedometers.
|
Hmm, that's very interesting, thank you for that useful reference information.
Re: General Reference -
Schocc - 17.12.2012
Adding the parameter
timer Interval in milliseconds (To auto Hide)
pawn Код:
TextDrawShowForPlayer( playerid, Text:text, Interval );
TextDrawShowForAll( Text:text, Interval );
Re: General Reference -
SilverKiller - 03.02.2013
Quote:
Originally Posted by ******
Yes, the text draw!
|
Good Job, ******
Re: General Reference -
mastermax7777 - 11.02.2013
can i get the SOUND ID of Player getting hurt?
like something from PAIN_A ? (but not neccesary)
help
Re: General Reference -
Austin - 04.04.2013
Not sure how well known this is, only just figured this out for myself.
I wanted to limit the length of a string in a format, and usually I would have a separate string of the needed length, or use strmid, but I figured out that it can be done in format just like it can be done with floats.
This would show a float as a maximum of 4 decimal points.
Код:
format(str, sizeof(str), "%0.4f", somefloat);
You would think that this potentially the method to limit a string to 10 characters would be...
Код:
format(str, sizeof(str), "%10s", somestring);
...but it's not, it's the same as the float...
Код:
format(str, sizeof(str), "%0.10s", somestring);
... one thing that might be possible (haven't checked yet) is to use %5.10s to start at the 6th character in the string and take 10 characters from that point.
Sorry if this is old news.
Re: General Reference -
LarzI - 04.04.2013
Quote:
Originally Posted by Austin
Not sure how well known this is, only just figured this out for myself.
I wanted to limit the length of a string in a format, and usually I would have a separate string of the needed length, or use strmid, but I figured out that it can be done in format just like it can be done with floats.
This would show a float as a maximum of 4 decimal points.
Код:
format(str, sizeof(str), "%0.4f", somefloat);
You would think that this potentially the method to limit a string to 10 characters would be...
Код:
format(str, sizeof(str), "%10s", somestring);
...but it's not, it's the same as the float...
Код:
format(str, sizeof(str), "%0.10s", somestring);
... one thing that might be possible (haven't checked yet) is to use %5.10s to start at the 6th character in the string and take 10 characters from that point.
Sorry if this is old news.
|
Didn't know this - thanks!
I think this would be more fitting in the Tips & Tricks thread, though.
Re: COMANDO COM LIMITE DE DISTГNCIA -
Smoking_Script - 18.07.2013
nice
Re: General Reference - Guest4390857394857 - 30.04.2014
Good job guys
Re: General Reference -
MarvinPWN - 01.09.2015
Quote:
Originally Posted by SoFahim
Please fix all links. They are not valid
|
Which links do you mean?
Re: General Reference -
Yashas - 17.10.2015
Default Ammo given by Weapon Pickups
Pickup ID | Pickup Name | Ammo Given |
321 | Regular Dildo | 1 |
322 | White Dildo | 1 |
323 | Vibrator | 1 |
324 | Another Vibrator | 1 |
325 | Flowers | 1 |
326 | Cane | 1 |
331 | Brass Knuckles | 1 |
333 | Golf Club | 1 |
334 | Night Stick | 1 |
335 | Combat Knife | 1 |
336 | Baseball Bat | 1 |
337 | Shovel | 1 |
338 | Pool Cue | 1 |
339 | Katana | 1 |
341 | Chainsaw | 1 |
342 | Frag Grenade | 8 |
343 | Tear Gas Grenade | 8 |
344 | Molotov Cocktail | 8 |
346 | Colt 45 Pistol | 30 |
347 | Silenced Colt 45 Pistol | 10 |
348 | Desert Eagle | 10 |
349 | Regular Shotgun | 15 |
350 | Sawn-Off Shotgun | 10 |
351 | Combat Shotgun/SPAZ-12 | 10 |
352 | Micro UZI | 60 |
353 | MP5 | 60 |
355 | AK-47 Assault Rifle | 80 |
356 | M4 Assault Rifle | 80 |
357 | Country Rifle | 20 |
358 | Sniper Rifle | 10 |
359 | Rocket Launcher | 4 |
360 | Heat Seeking Rocket Launcher | 3 |
361 | Flamethrower | 100 (Client see it as 10) |
362 | Minigun | 500 |
363 | Satchel Charges | 5 |
365 | Spray Paint Can | 500 |
367 | Camera | 36 |
368 | Night Vision Goggles | Cannot be collected as pickup |
369 | Infra-Red ******s | Cannot be collected as a pickup |
371 | Parachute | 1 |
372 | Tech-9 | 60 |
Re: General Reference -
GangstaSunny - 05.02.2016
PHP Code:
stock GetNulledTimeFormat()
{
new Year, Month, Day, Hour, Minute, Second;
new monthstr[11], daystr[11], hourstr[11], minutestr[11], secondstr[11], result[32];
getdate(Year, Month, Day); gettime(Hour, Minute, Second);
if(Day > 9){format(daystr,sizeof(daystr),"%d",Day);}
else if(Day < 10){format(daystr,sizeof(daystr),"0%d.",Day);}
if(Month > 9){format(monthstr,sizeof(monthstr),"%d.%d",Month,Year);}
else if(Month < 10){format(monthstr,sizeof(monthstr),"0%d.%d",Month,Year);}
if(Hour > 9){format(hourstr,sizeof(hourstr)," %d:",Hour);}
else if(Hour < 10){format(hourstr,sizeof(hourstr)," 0%d:",Hour);}
if(Minute > 9){format(minutestr,sizeof(minutestr),"%d:",Minute);}
else if(Minute < 10){format(minutestr,sizeof(minutestr),"0%d:",Minute);}
if(Second > 9){format(secondstr,sizeof(secondstr),"%d",Second);}
else if(Second < 10){format(secondstr,sizeof(secondstr),"0%d",Second);}
strcat(result, daystr); strcat(result, monthstr); strcat(result, hourstr);
strcat(result, minutestr); strcat(result, secondstr);
return result;
}
Code:
Will return something like | 05.02.2016 08:25:10
Re: General Reference -
Crayder - 10.02.2016
Quote:
Originally Posted by GangstaSunny
PHP Code:
stock GetNulledTimeFormat()
{
new Year, Month, Day, Hour, Minute, Second;
new monthstr[11], daystr[11], hourstr[11], minutestr[11], secondstr[11], result[32];
getdate(Year, Month, Day); gettime(Hour, Minute, Second);
if(Day > 9){format(daystr,sizeof(daystr),"%d",Day);}
else if(Day < 10){format(daystr,sizeof(daystr),"0%d.",Day);}
if(Month > 9){format(monthstr,sizeof(monthstr),"%d.%d",Month,Year);}
else if(Month < 10){format(monthstr,sizeof(monthstr),"0%d.%d",Month,Year);}
if(Hour > 9){format(hourstr,sizeof(hourstr)," %d:",Hour);}
else if(Hour < 10){format(hourstr,sizeof(hourstr)," 0%d:",Hour);}
if(Minute > 9){format(minutestr,sizeof(minutestr),"%d:",Minute);}
else if(Minute < 10){format(minutestr,sizeof(minutestr),"0%d:",Minute);}
if(Second > 9){format(secondstr,sizeof(secondstr),"%d",Second);}
else if(Second < 10){format(secondstr,sizeof(secondstr),"0%d",Second);}
strcat(result, daystr); strcat(result, monthstr); strcat(result, hourstr);
strcat(result, minutestr); strcat(result, secondstr);
return result;
}
Code:
Will return something like | 05.02.2016 08:25:10
|
First off, this should be in Useful Functions.
Now, learn more about formatting...
pawn Code:
if(Second > 9){format(secondstr,sizeof(secondstr),"%d",Second);}
else if(Second < 10){format(secondstr,sizeof(secondstr),"0%d",Second);}
Could simply be this:
pawn Code:
format(secondstr,sizeof(secondstr),"%02d",Second);
The '0' is to make it use leading zeros, '2' is the 'at least this many characters' amount.