SA-MP Forums

Go Back   SA-MP Forums > Search Forums

Showing results 1 to 14 of 14
Search took 0.00 seconds.
Search: Posts Made By: Paglia
Forum: Everything and Nothing 16/02/2018, 09:45 PM
Replies: 9
Views: 804
Posted By Paglia
Re: Anyone have some feedback? (C code)

Oh I see, thanks for such a detailed response!

Right now I have some other projects to take care of, but once I get most of them out of the way I'll return to look at these notes and your updated...
Forum: Everything and Nothing 15/02/2018, 05:14 PM
Replies: 9
Views: 804
Posted By Paglia
Re: Anyone have some feedback? (C code)

It is meant to be read from the console directly, the book hasn't touched file input yet. So far, only "line inputs" have been discussed, but it seemed simpler to do it character by character rather...
Forum: Everything and Nothing 15/02/2018, 03:15 PM
Replies: 9
Views: 804
Posted By Paglia
Re: Anyone have some feedback? (C code)

That case works, the code handles it in the way that it counts all non-whitespace characters and evaluates the gap based on the tabsize we defined on the top of the file - that number of...
Forum: Everything and Nothing 14/02/2018, 09:49 PM
Replies: 9
Views: 804
Posted By Paglia
Anyone have some feedback? (C code)

Hey guys, I started revisiting K&R's 2nd edition and I solved for a particular problem but I want to see if there's more efficient solutions (keep in mind that I'm only looking for solutions in C).
...
Forum: Includes 07/02/2018, 08:24 PM
Replies: 31
Views: 3,566
Posted By Paglia
Re: OnPlayerWeaponShot Bug Fix + Extended HitType

This happens to all sorts of community projects: its much better to have only your name on an include/post itself vs. a commit to an already existing attempt at fixing a "bigger picture" of the issue...
Forum: Filterscripts 24/01/2018, 07:36 PM
Replies: 28
[FilterScript] [FS] Efficient Anti-Flood
Views: 20,420
Posted By Paglia
Re: [FS] Efficient Anti-Flood

The syntax for the ternary operator is

(expression to be evaluated) ? code to be ran if true : code to be ran if false

This can be used in an assignment statement as follows:

isAlive =...
Forum: Bug Reports 20/01/2018, 04:32 PM
Replies: 10
Views: 8,211
Posted By Paglia
Lightbulb Re: OnPlayerWeaponShot when shooting a driver/passenger

I don't know if this will be of much help but it may be somewhat related to this issue.

When a player is on foot, then CPlayer* points to the player itself. However, when a player is on a vehicle,...
Forum: Scripting Help 25/07/2013, 11:31 PM
Replies: 15
Views: 888
Posted By Paglia
Forum: Scripting Help 25/07/2013, 11:23 PM
Replies: 15
Views: 888
Posted By Paglia
Re: 1 score every 1 Min

This will be very easy, under OnPlayerUpdate function (updates every second) type this:

SetPlayerScore(playerid,GetPlayerScore(playerid) + 1;
Forum: Scripting Help 25/07/2013, 10:56 PM
Replies: 9
Views: 565
Posted By Paglia
Re: Count players

Try this:

stock CheckPlayers(vworld,interior)
{
for(new _i=0; _i<MAX_PLAYERS; _i++)
{
new TotalPlayers;
new msg[64];
if(GetPlayerVirtualWorld(i) == vworld)
{
Forum: Scripting Help 25/07/2013, 08:24 PM
Replies: 2
Views: 364
Posted By Paglia
Forum: Scripting Help 25/07/2013, 08:15 PM
Replies: 2
Views: 364
Posted By Paglia
Convert String to Integer

Hey everyone! I have the doubt in how to convert a string, specially the "inputtext" on OnDialogResponse, to a number, and be able to use it as one.


Thanks!
Forum: Scripting Help 25/07/2013, 05:55 PM
Replies: 4
Views: 364
Posted By Paglia
Re: ID bug

Use this instead:

format(string,128,"KICKED- %s[%d] TEMP BAN BECAUSE:%s",giveplayer,GetPlayerID(giveplayer),reason);
Forum: Scripting Help 25/07/2013, 05:04 PM
Replies: 2
Views: 300
Posted By Paglia
Re: on format: Four errors

Check that you haven't already defined somewhere else the variable in the gamemode.

Ex:
new RandomVar;

..... code in between....

new RandomVar
Showing results 1 to 14 of 14

 

All times are GMT. The time now is 01:32 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.