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

Username
  

Password
  





Search Forums



(Advanced Search)

Forum Statistics
» Members: 7,054
» Latest member: adrianosilvaborges428
» Forum threads: 2,355
» Forum posts: 12,245

Full Statistics

Online Users
There are currently 309 online users.
» 0 Member(s) | 306 Guest(s)
Bing, Google, Yandex

Latest Threads
Plan C: Protect The Presi...
Forum: Advertisements
Last Post: PipPo
4 hours ago
» Replies: 0
» Views: 9
CODE5 GAMING COPS AND ROB...
Forum: Advertisements
Last Post: ryanthiago789
Yesterday, 03:02 AM
» Replies: 0
» Views: 26
SAMP RP project in 2024? ...
Forum: General Discussions
Last Post: tommchris
Yesterday, 02:05 AM
» Replies: 4
» Views: 2,461
Infekcja 2: Zombie Surviv...
Forum: Serwery
Last Post: tunnelrushgame3d
Yesterday, 01:50 AM
» Replies: 1
» Views: 188
FPS issues
Forum: General Discussions
Last Post: kourtneyroberts
2025-04-28, 04:53 AM
» Replies: 0
» Views: 20
How to make your GTA SA:M...
Forum: Tutorials
Last Post: NoxxeR
2025-04-27, 11:26 AM
» Replies: 1
» Views: 76
Problem about pawnbot
Forum: Pawn Scripting
Last Post: balkanspeed18
2025-04-26, 02:04 PM
» Replies: 0
» Views: 39
Error
Forum: Pawn Scripting
Last Post: -N0FeaR-
2025-04-25, 12:05 PM
» Replies: 0
» Views: 40
GTA Multigames [ MultiMod...
Forum: Advertisements
Last Post: Undead
2025-04-25, 07:37 AM
» Replies: 0
» Views: 50
Atlanta DeathMatch
Forum: Advertisements
Last Post: NixaSha
2025-04-25, 01:19 AM
» Replies: 0
» Views: 44

 
  GetPlayerCameraAspectRatio
Posted by: robertocaribbean - 2021-03-23, 09:37 PM - Forum: Pawn Scripting - Replies (2)

Hello everyone.

I have read in the open.mp documentation about this function, and if I understand correctly it can only return three values:

Widescreen ON: Should be 1.7764707 but I get 1.000000.
Widescreen OFF: Should be 1.3333334 but I get 1.000000.
5:4 when the LETTERBOX mode is ON: 1.2470589. I don't know how to test this.

Is there something I'm not understanding or is the wiki wrong?

Here is the code:

PHP Code:
public OnPlayerConnect(playerid) {
? ? new 
Float:pAspectRatio;
? ? 
pAspectRatio GetPlayerCameraAspectRatio(playerid);

? ? new 
str[80];
? ? 
format(strsizeof(str), "Your aspect ratio is: %f"pAspectRatio);
? ? print(
str);


  [Solved] GetAnimationName() is not working properly
Posted by: Radical - 2021-03-23, 08:43 PM - Forum: Pawn Scripting - Replies (2)

SOLUTION:

Store that animation lib and name in a variable.

e.g. :

Code:
new rAnimLib[MAX_PLAYERS][20];

new rAnimName[MAX_PLAYERS][20];



COMMAND:anim(playerid, params[]) {

? ? ApplyAnimation(playerid, "PED", "IDLE_STANCE", 4.1, 0, 0, 0, 0, 0);

? ? rAnimLib[playerid] = "PED";

? ??rAnimName[playerid] = "IDLE_STANCE";

? ? return 1;

}



GetAnimationNameEx(playerid, Lib[20], Name[20])

{

? ? Lib = rAnimLib[playerid];

? ? Name = rAnimName[playerid];

}

//use this method instead of GetAnimationName.





I use GetAnimationName() function but it only returns PED, IDLE_STANCE or PED,SEAT_IDLE or PED,WOMAN_IDLESTANCE.



When i apply another animations like /eat, /sit, /lay

this function not give me the applied animation animlib and animname but just return PED, IDLE_STANCE.



PHP Code:
ApplyAnimation(playerid,"BEACH","Lay_Bac_Loop",4.1011111); // Sit

ApplyAnimation(playerid,"BEACH""bather",4.1011111); // Lay down



CMD:anim(playerid) {

? ? if(
GetPlayerAnimationIndex(playerid))

{

? ? new 
animlib[32];

? ? new 
animname[32];

? ? new 
msg[128];? ? 

? ? 
GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32);

? ? 
format(msg128"Running anim: %s %s"animlibanimname);

? ? 
SendClientMessage(playerid, -1msg); // output is: PED IDLE_STANCE

}

? ? return 
1;





In other gamemodes that I test, this problem does not occur.



I need to fix this problem quickly.

thanks for the anyone answer.


  [FIXED] can't run many timers, that are not working with backtrace notification.
Posted by: PutuSuhartawan - 2021-03-23, 03:59 PM - Forum: Pawn Scripting - Replies (4)

Quote:Change to

SetTimerEx("PublicOwned", 1000, true, "i", playerid);





sorry, I am confused about the mistake where when I install a lot of timer functions it can't work. I also can't run the isvalidtimer function because that include is empty. is there a way to install the correct include timerfix?



Quote:Does not work if it repeats:

SetTimer ("TimeServer", 500, true);

SetTimer ("Change_Color", 5000, true);

will run if one call:

SetTimer ("UnFreezeMe", 3000.0);


  Whitelist System
Posted by: Genon_May - 2021-03-23, 08:42 AM - Forum: General Discussions - Replies (3)

Hey, im wondering does anyone know where i can find a whitelist system for samp. There used to be a few on the samp forums but cant reach them right now since they are down. If anyone knows where i can find one (english version) i would be very grateful


Question Which one is better, MYSQL or Y_INI? Why?
Posted by: Areshk - 2021-03-23, 03:36 AM - Forum: General Discussions - Replies (1)

I'm developing my own gamemode for samp but some people tell me that Mysql is better and I should use it.



I don't know if they are right or I should continue using Y_INI.



What do you recommend? :(


  A tool/program for finding unmatched brackets?
Posted by: Fawkes - 2021-03-22, 06:10 PM - Forum: Pawn Scripting - Replies (4)

I'm trying to optimize a script i made a few years ago and seperate it into libraries, i'm re-compiling it after every couple of changes to try and make it as easy as possible to identify errors and mistakes as i go along.

At the moment it won't compile (using pawno) unless i scroll to the bottom of the script first and compile from there (no errors or warnings if i don't scroll to the bottom first, it just doesn't create a working AMX unless i scroll to the bottom before compiling), i've checked the brackets with ctrl F and i've got 3 unmatched brackets (from years ago) which i remember used to cause the same problem in the past.

Does anyone know of any online web programs or software to highlight where unmatched bracket openings/closings begin/end without having to disect the whole script piece-by-piece to narrow down the lines manually?

I've tried searching for something to do this but they just give a long list of errors/warnings unrelated to brackets because they're intended for non-pwn.

Any help or suggestions would be great.


  [FIXED] inputtext cant extract to integer variable just made number 0, strval
Posted by: PutuSuhartawan - 2021-03-22, 02:33 PM - Forum: Pawn Scripting - Replies (2)

Quote:extract?inputtext[20]?->?new?BidPrice;



Why the integer after extract the iputtext variable has found = 0?

How to extract inputtext variable?to integer actually?



FIXED

Inputtext is a string data type, you have to change it to an integer first. If you want to store it to a variable that has an integer type, use a function called strval. So strval (inputtext)

BidPrice = strval(inputtext);


  Military equipment
Posted by: Poljon - 2021-03-22, 09:13 AM - Forum: Questions and Suggestions - Replies (5)

Could you make some other equipment besides the tank, such as a Stryker for the army and new types of combat aircraft, turntables and armored vehicles?/


  sqlite and inputtext
Posted by: robertocaribbean - 2021-03-21, 05:42 PM - Forum: Pawn Scripting - Replies (6)

I am trying to create an SQLite database, I only have three variables to keep it simple.



The problem is that the password is not saved unless I pass <inputtext> directly to the query.



Variables:



Code:
enum USER_DATA {

? ? USER_ID,

? ? USER_NICKNAME[MAX_PLAYER_NAME],

? ? USER_PASSWORD[20]

};



new gUserData[MAX_PLAYERS][USER_DATA];





Code working:





Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {

? ? switch (dialogid) {

? ? ? ? case DIALOG_REGISTRATION: {

? ? ? ? ? ? if (!response) return Kick(playerid);



? ? ? ? ? ? if (!(3 <= strlen(inputtext) <= 20)) {

? ? ? ? ? ? ? ? SendClientMessage(playerid, -1, "Tu contrase?a debe tener entre 3 y 20 car?cteres");

? ? ? ? ? ? ? ? ShowPlayerDialog(playerid, DIALOG_REGISTRATION, DIALOG_STYLE_PASSWORD, "Register", "Type in a password below to register an account.", "Register", "Leave" );

? ? ? ? ? ? ? ? return 1;

? ? ? ? ? ? }



? ? ? ? ? ? new query[208], DBResult: result;

? ? ? ? ? ?

? ? ? ? ? ? format(query, sizeof query, "INSERT INTO users (nickname, password) VALUES ('%q', '%s')", gUserData[playerid][USER_NICKNAME], inputtext);



? ? ? ? ? ? db_query(db_handle, query);



? ? ? ? ? ? SendClientMessage(playerid, 0x00FF00FF, "[SERVER]: You have just registered to our server! You have been automatically logged in!");



? ? ? ? ? ? result = db_query(db_handle, "SELECT last_insert_rowid()");

? ? ? ? ? ? gUserData[playerid][USER_ID] = db_get_field_int(result);



? ? ? ? ? ? db_free_result(result);

? ? ? ? }

? ? }

? ? return 1;

}



Code isn't working:



Code:
gUserData[playerid][USER_PASSWORD] = inputtext[strlen(inputtext)];? ? ? ? ? ?



? ? ? ? ? ? format(query, sizeof query, "INSERT INTO users (nickname, password) VALUES ('%q', '%s')", gUserData[playerid][USER_NICKNAME], gUserData[playerid][USER_PASSWORD]);



The password field on the database is empty, and other values are ok. No error has given from the compiler.


  How to save the position of a car?
Posted by: Boxi - 2021-03-21, 11:45 AM - Forum: Pawn Scripting - Replies (1)

Hello everyone :'D?



Would anyone know how to make a system to save the position of a car? where the player leaves his car somewhere and when he connects again the car is there, basically how is the saving of the player's position. Obviously I'm not asking for any of you to write that code, just an idea of where I should start if I wanted to do it. Greetings to all.