Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums



(Advanced Search)

Forum Statistics
» Members: 7,905
» Latest member: werzel
» Forum threads: 2,398
» Forum posts: 12,308

Full Statistics

Online Users
There are currently 405 online users.
» 0 Member(s) | 403 Guest(s)
Google, Bing

Latest Threads
Looking for Players for N...
Forum: Chat
Last Post: AlmightyJeremy
Yesterday, 11:22 PM
» Replies: 0
» Views: 26
Manual sorting of servers...
Forum: Questions and Suggestions
Last Post: cherybomb
Yesterday, 02:58 AM
» Replies: 2
» Views: 1,432
Project: Las Venturas Rol...
Forum: Advertisements
Last Post: Kremzy
2026-02-02, 10:14 PM
» Replies: 0
» Views: 47
Looking for Players for N...
Forum: Advertisements
Last Post: AlmightyJeremy
2026-02-02, 07:04 PM
» Replies: 0
» Views: 38
ExDM Reborn
Forum: Advertisements
Last Post: 0775448400
2026-02-02, 03:38 PM
» Replies: 1
» Views: 78
IPv6 support
Forum: Questions and Suggestions
Last Post: Markski
2026-02-02, 12:58 AM
» Replies: 1
» Views: 53
AntyCheat System [SA-MP/O...
Forum: Filterscripts
Last Post: Pevenaider
2026-01-27, 08:48 PM
» Replies: 11
» Views: 19,333
problema afisare dialog c...
Forum: Romanian/Rom?na
Last Post: rcst3phan
2026-01-27, 07:31 PM
» Replies: 0
» Views: 90
problem dialog clan membe...
Forum: Pawn Scripting
Last Post: rcst3phan
2026-01-27, 07:30 PM
» Replies: 0
» Views: 94
Verona Community opening
Forum: Advertisements
Last Post: pmemorex2016
2026-01-27, 07:01 AM
» Replies: 0
» Views: 73

 
  Best practice with timers
Posted by: RhaegarX - 2021-01-21, 02:16 AM - Forum: Pawn Scripting - Replies (3)

Hello guys!? I would like to ask a question about the use of timers.? Suppose I have several systems that do checks from time to time, the best way would be to create a single timer that does all the checks or create multiple timers to check each thing?? Which way would be the most optimized and least burdensome on the server?

Code 1:

PHP Code:
SetTimer("ExecuteAll"1000false);

public 
ExecuteAll()
{
    
// Verification 1
    // Verification 2
    // Verification 3
    
...


Code 2:

PHP Code:
SetTimer("Execute1"1000false);
SetTimer("Execute2"1000false);
SetTimer("Execute3"1000false);

public 
Execute1()
{
    
// Verification 1
}
public 
Execute2()
{
    
// Verification 2
}
public 
Execute3()
{
    
// Verification 3


  .
Posted by: Jaua - 2021-01-20, 10:46 PM - Forum: Programaci?n - Replies (2)

.....


Photo Mirrors in SAMP!
Posted by: Polter - 2021-01-20, 08:39 PM - Forum: Videos and Screenshots - Replies (2)

Hey guys, just a little sneak peak of what i came across today, i got an idea in my head i manage to make a real mirror that reflects everything what is in front of it. This are only couple objects grouped together, but in near future I hope that ill make a realistic object of mirror to implement every thing together to look even more realistic for Roleplay servers.



Tell me what do you think?



[Image: F0UFd0B.png]

[Image: 3sECMAn.png]


  Ternary Operator Basics
Posted by: RhaegarX - 2021-01-20, 07:29 PM - Forum: Tutorials - Replies (4)

"Sorry for the bad English, I'm using the translator to do this tutorial."



- What is a ternary operator?



In various situations in programming we need to deal with various scenarios, through conditional structures, such as if, else and switch. However, in some situations we deal with wave situations there are only 2 possible returns.



For example, let's imagine a hypothetical situation, in which if the player is an administrator he wins $ 1500, otherwise he will win $ 500.

We can do this logic using the if and else operator:



PHP Code:
if (PlayerData[playerid][pAdmin] > 0)

{? ? ? ? ? 

? ? 
GivePlayerMoney(playerid1500);





else

{

? ? 
GivePlayerMoney(playerid500);





Now notice that we are making a relatively long structure for a simple action, with only two possibilities. Is there no other way to write this code in a simpler way? Yes, there is, and that is what the ternary operator is for:



PHP Code:
GivePlayerMoney(playerid, (PlayerData[playerid][pAdmin] > 1500 500)); 



Now we did the same action with just one line of code, however let's understand a little bit about how to build a ternary operator.



- How to build a ternary operator?



Building a ternary operator is simple, its own structure is self-explanatory.



PHP Code:
(condition value if true value if false



To better understand, we can see that the '?' acts as an if and the ':' acts as the else.



- In what situations will I use the ternary operator?



This is a relative question, it depends a lot on the type of logic that you will build for your system, but as stated in the first question we will use the ternary operator for situations in which there are only 2 possibilities of return. Remembering that the ternary operator is not limited to returning only number values, but can also return strings and other options.



Example of a string with a ternary operator:



PHP Code:
SendClientMessage(playerid, -1, (playerData[playerid][pAdmin] > "True" "false")); 



- Problems with ternary operator



The main problem with the ternary operator is its structure, which because it is very compact, its structure can be difficult to read by programmers who are not used to it.



- End



This is my first personal authoring tutorial, i hope you like it and criticism will always be welcome!


  TSConnector and some other fce
Posted by: Ardenis - 2021-01-20, 06:46 PM - Forum: Pawn Scripting - Replies (1)

Hey there

the TS_PokeClient function does not work correctly. When someone joins the game, they poke them ?

let's look at the code

Code:
public TSC_OnClientConnect (clientid, nickname [])
{
new str[50];
format(str, sizeof(str), "> %s (%d) has join to our ts3 server", nickname, clientid);
SendClientMessageToAll(-1, str);
TSC_SendClientMessage(clientid, "Yup, here it works");
TSC_PokeClient(clientid, "Welcome"); // But not here, it not poke him but idk why
return 1;
}

http://prntscr.com/xb40i1
https://github.com/maddinat0r/samp-tsconnector/releases


  Divide by zero
Posted by: Zow - 2021-01-20, 06:02 PM - Forum: Pawn Scripting - Replies (1)

Code:
ExpProgress(playerid)

{

? ? new Float:exp = playerData[playerid][pExp]*100/PlayerRequiredExp(playerid);

? ? return exp;

}



PlayerRequiredExp(playerid)

{

? ? new requiredexp = playerData[playerid][pLevel] * 2000;

return requiredexp;

}



pExp are always start from 0 when you're level up

So crashdetect always give me this?Run time error 11: "Divide by zero"

I need some idea how to get pass this one

I just want to popup exp to % but I need pExp to start by 0 when level up

Is that possible?


  How much cpu & ram requirement for sa-mp server?
Posted by: LinesinRows - 2021-01-20, 01:33 PM - Forum: Support - No Replies

? Hello,

?I'm making a rp mod from 0. A few months later, i will be open my server. But i don't know, how much cpu & ram requirement?for?sa-mp server? (etc: 500 players)

? Thanks for now.


  Why my code only sends "else"?
Posted by: sampaux - 2021-01-20, 12:50 PM - Forum: Pawn Scripting - Replies (1)

Code:
for(new i = 0;i < 100;i)

{

if(PlayerInfo[i][cargo] != 0)

{

? ? GameTextForPlayer(i, "~r~Novo Report!", 3000, 5);

? ? GetPlayerName(id, reportado, sizeof(reportado));

? ? GetPlayerName(playerid, reportador, sizeof(reportador));

? ? format(report, sizeof(report), "Nick e id: %s [%d]\nMotivo: %s\nReportado por: %s", reportado, id, motivo, reportador);

? ? SendClientMessage(i, -1, "====={4291ff}Novo Report{FFFFFF}=====");

? ? SendClientMessage(i, -1, report);

}

else

{

SendClientMessage(i, -1, "asdadsadad");//I put it?in else?to prove that code only sends else

}



this code is a /report command. PlayerInfo[][cargo] == Admin level

despite my PlayerInfo[][cargo] != 0 in?game, this code keep sending the else,? considering?PlayerInfo[][cargo] == 0

Basically, it sends "?SendClientMessage(i, -1, "asdadsadad"); " for all online admins instead of the fist code,?and this is not what should happen



Fix it?is easy, obviously just invert?the codes.?But i want know WHY THIS OCCURS???


  Tutorials
Posted by: RhaegarX - 2021-01-20, 11:33 AM - Forum: General Discussions - Replies (2)

Hi guys, I was browsing the pages of sampforumarchiv reviewing some topics, and then I thought about re-posting some tutorials and includes the old samp forum (with due credit to each creator) to be able to move the community more and help those who are new and there's nowhere to go. What do you think of the idea?


  [MAP] PUB Interior | Mirsat24
Posted by: mirsat24 - 2021-01-20, 06:12 AM - Forum: Videos and Screenshots - Replies (3)

Discord:Mirsat24#8134



If you comment, you will make me happy :)



[Video: http://https://www.youtube.com/watch?v=J7DmeBKX4_w]