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

Username
  

Password
  





Search Forums



(Advanced Search)

Forum Statistics
» Members: 7,496
» Latest member: u888brbrcom
» Forum threads: 2,412
» Forum posts: 12,359

Full Statistics

Online Users
There are currently 929 online users.
» 1 Member(s) | 924 Guest(s)
Google, Applebot, Bing, DuckDuckGo, swuffted

Latest Threads
Adding new vehicles and s...
Forum: Programming
Last Post: __.A.__
Yesterday, 07:47 PM
» Replies: 0
» Views: 46
Zona América del Sur Free...
Forum: Advertisements
Last Post: kevinberriosflores
Yesterday, 02:16 PM
» Replies: 1
» Views: 68
Busco copia de gamemode S...
Forum: Spanish/Espa?ol
Last Post: briancristaldo2021
2025-09-11, 11:14 AM
» Replies: 0
» Views: 56
[Tutorial] Registrando o ...
Forum: Portuguese/Portugu?s
Last Post: Crazy_ArKzX
2025-09-09, 08:36 PM
» Replies: 0
» Views: 198
San Andreas Police Pursui...
Forum: Advertisements
Last Post: BriBri
2025-09-08, 10:09 PM
» Replies: 1
» Views: 287
Problem with plugins load...
Forum: Support
Last Post: MrKacu13
2025-09-08, 07:15 PM
» Replies: 9
» Views: 335
Compilation error
Forum: Pawn Scripting
Last Post: MrKacu13
2025-09-07, 07:18 AM
» Replies: 6
» Views: 336
Need help, problem when i...
Forum: Programming
Last Post: nonickowned
2025-09-06, 06:21 PM
» Replies: 0
» Views: 142
Transfer server from SAMP...
Forum: Support
Last Post: MrKacu13
2025-09-06, 04:03 PM
» Replies: 1
» Views: 234
Not relevant anymore
Forum: Questions and Suggestions
Last Post: peti
2025-09-05, 02:00 PM
» Replies: 0
» Views: 192

 
  [ERROR] cache_set_active: invalid cache id '0'
Posted by: Zow - 2019-07-18, 12:48 PM - Forum: Pawn Scripting - Replies (1)

Whatis going on to these code



Orginal code from:?https://github.com/pBlueG/SA-MP-MySQ...stem-cache.pwn



Code:
[19:02:17] [ERROR] cache_set_active: invalid cache id '0'

[19:02:17] [ERROR] cache_get_value_name_int: no active cache

[19:02:17] [ERROR] cache_get_value_name_int: no active cache

[19:02:17] [ERROR] cache_get_value_name_int: no active cache

[19:02:17] [ERROR] cache_get_value_name_float: no active cache

[19:02:17] [ERROR] cache_get_value_name_float: no active cache

[19:02:17] [ERROR] cache_get_value_name_float: no active cache

[19:02:17] [ERROR] cache_get_value_name_float: no active cache

[19:02:17] [ERROR] cache_get_value_name_int: no active cache

[19:02:17] [ERROR] cache_get_value_name_int: no active cache

[19:02:17] [ERROR] cache_get_value_name_int: no active cache

[19:02:17] [ERROR] cache_delete: invalid cache id '0' ?



Code:
? ? ? ?case DIALOG_LOGIN:

? ? ? ?{

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



? ? ? ? ? ?new hashed_pass[65];

? ? ? ? ? ?SHA256_PassHash(inputtext, Player[playerid][Salt], hashed_pass, 65);



? ? ? ? ? ?if (strcmp(hashed_pass, Player[playerid][Password]) == 0)

? ? ? ? ? ?{



? ? ? ? ? ? ? ?// sets the specified cache as the active cache so we can retrieve the rest player data

? ? ? ? ? ? ? ?cache_set_active(Player[playerid][Cache_ID]);



? ? ? ? ? ? ? ?AssignPlayerData(playerid);



? ? ? ? ? ? ? ?// remove the active cache from memory and unsets the active cache as well

? ? ? ? ? ? ? ?cache_delete(Player[playerid][Cache_ID]);

? ? ? ? ? ? ? ?Player[playerid][Cache_ID] = MYSQL_INVALID_CACHE;



? ? ? ? ? ? ? ?KillTimer(Player[playerid][LoginTimer]);

? ? ? ? ? ? ? ?Player[playerid][LoginTimer] = 0;

? ? ? ? ? ? ? ?Player[playerid][IsLoggedIn] = true;

? ? ? ? ? ? ? ?TogglePlayerSpectating(playerid, false);



? ? ? ? ? ? ? ?// spawn the player to their last saved position after login

? ? ? ? ? ? ? ?SetSpawnInfo(playerid, NO_TEAM, DEFAULT_SKIN, Player[playerid][Pos_X], Player[playerid][Pos_Y], Player[playerid][Pos_Z], Player[playerid][Pos_A], 0, 0, 0, 0, 0, 0);

? ? ? ? ? ? ? ?SpawnPlayer(playerid);

? ? ? ? ? ?}

? ? ? ? ? ?else

? ? ? ? ? ?{

? ? ? ? ? ? ? ?Player[playerid][LoginAttempts];



? ? ? ? ? ? ? ?if (Player[playerid][LoginAttempts] >= 3)

? ? ? ? ? ? ? ?{

? ? ? ? ? ? ? ? ? ?ShowPlayerDialog(playerid, DIALOG_UNUSED, DIALOG_STYLE_MSGBOX, "[Login step]", "?س??????ʼ?ҹ?Դ?֧ 3 ?????, ?֧ⴹ?к?????͡?ҡ???????????", "?Դ", "");

? ? ? ? ? ? ? ? ? ?DelayedKick(playerid);

? ? ? ? ? ? ? ?}

? ? ? ? ? ? ? ?else ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "[Login step]", "???ʼ?ҹ????١??ͧ!\n**??س???????ʼ?ҹ????????????????!", "???????", "¡??ԡ");

? ? ? ? ? ?}

? ? ? ?}



AssignPlayerData(playerid)

{

? ?cache_get_value_int(0, "ID", Player[playerid][ID]);



? ?cache_get_value_int(0, "Kills", Player[playerid][Kills]);

? ?cache_get_value_int(0, "Deaths", Player[playerid][Deaths]);



? ?cache_get_value_float(0, "PosX", Player[playerid][Pos_X]);

? ?cache_get_value_float(0, "PosY", Player[playerid][Pos_Y]);

? ?cache_get_value_float(0, "PosZ", Player[playerid][Pos_Z]);

? ?cache_get_value_float(0, "PosA", Player[playerid][Pos_A]);

? ?

? ?cache_get_value_int(0, "Interior", Player[playerid][Interior]);

? ?cache_get_value_int(0, "Skin", Player[playerid][Skin]);

? ?cache_get_value_int(0, "Account", Player[playerid][Account]);

? ?return 1;

} ?



error spot after logged in every login


  Server & Client Updates
Posted by: NexoR - 2019-07-17, 12:19 PM - Forum: Questions and Suggestions - Replies (11)

Will the server and client be notified if an update is available ?



Because there is no SA-MP.


  [easyMysql] error 001: expected token: "-string end-", but found "-identifier-"
Posted by: Aerotactics - 2019-07-17, 06:20 AM - Forum: Pawn Scripting - Replies (2)

I don't see what the issue is.



[Image: 68edcdeeb1.png]



EDIT:

Code:
1116: handle = SQL::CreateTable(table, (isnull(column_where)) ? "InnoDB" : column_where, (isnull(column_where2)) ? "latin5" : column_where2, connectionHandle);



1780: format(SQL::upd_form, sizeof(SQL::upd_form), "%s int %s AUTO_INCREMENT,", field_name, (null == false) ? "NOT NULL" : "NULL");



1788: format(SQL::upd_form, sizeof(SQL::upd_form), "%s int %s PRIMARY KEY AUTO_INCREMENT,", field_name, (null == false) ? "NOT NULL" : "NULL");


  Help
Posted by: Xylosjr - 2019-07-17, 05:19 AM - Forum: Pawn Scripting - Replies (1)


Hi, I'm new here and I want to learn how to program with mysql and connect a database


  Math: vertical viewing angle
Posted by: Freaksken - 2019-07-15, 08:18 PM - Forum: Programming - Replies (4)

I have a system in which I've worked out the code for giving an NPC a horizontal viewing angle (left image). How would I achieve a similar result, but now for the vertical direction (right image)?
[Image: viewing_angle.png?raw=1]

Below is the code for the left image, for reference. This is a math question, thus the code isn't really necessary, but might help you understand the problem. Just ignore that the angles start from the NPC's center instead of his eyes, that's easy enough to fix. As you can see, the z-position is irrelevant for the horizontal viewing angle, but probably not for the vertical viewing angle (not sure).

PHP Code:
static bool:FAI_IsPlayerInAggroViewingAngle(playeridnpcid) {
    
// Get NPC position
    
new Float:xnFloat:ynFloat:zn;
    
FCNPC_GetPosition(npcidxnynzn);

    
// Get player position
    
new Float:xpFloat:ypFloat:zp;
    if(!
IsPlayerNPC(playerid)) {
        
GetPlayerPos(playeridxpypzp);
    } else {
        
FCNPC_GetPosition(playeridxpypzp);
    }

    
// Calculate the angle between these 2 points
    
new Float:angleBetweenPoints atan2(xp xnyp yn);

    
// Get the NPC facing angle adjusted for the weird GTA angle system
    
new Float:npcFacingAngle 360.0 FCNPC_GetAngle(npcid);

    
// Calculate the smallest difference between these 2 angles as a value between -180.0 and 180.0
    
new Float:angleDifference angleBetweenPoints npcFacingAngle;
    if(
angleDifference 180.0) {
        
angleDifference -= 360.0;
    }
    if(
angleDifference < -180.0) {
        
angleDifference 360.0;
    }

    
// Get the absolute value of this angle
    
angleDifference floatabs(angleDifference);

    
// Check if the player is within the aggro viewing angle
    
if(angleDifference <= FAI_NPCs[npcid][FAI_NPC_AGGRO_VIEWING_ANGLE][playerid]/2) {
        return 
true;
    }
    return 
false;


Here's another visualisation of what the result should look like:
[Image: viewing_angle2.png?raw=1]


  Discord server
Posted by: RogueDrifter - 2019-07-15, 12:06 AM - Forum: Chat - Replies (4)

Unban roguedrifter from the discord server :sadface:


  A weird problem with includes
Posted by: mouiz - 2019-07-14, 01:00 PM - Forum: Pawn Scripting - Replies (7)

Quote:#include <../../gamemodes/modes/mode_robbery.pwn>

#include <../../gamemodes/modes/mode_dogfight.pwn>



These are ^ two includes in the 'gamemodes/modes' folder.





If i arrange them like this:?



Quote:#include <../../gamemodes/modes/mode_dogfight.pwn>

#include <../../gamemodes/modes/mode_robbery.pwn>



the 'mode_dogfight' works (gets included)?and the second one is ignored (it shows undefined symbol errors since the definitions of the functions are in the include)



If i arrange them oppositely then the 'mode_robbery' works, the second one is ignore.



How can i fix this?


  Pizza preferita?
Posted by: [SF]kAn3 - 2019-07-14, 01:59 AM - Forum: Italian/Italiano - Replies (2)

Beh almeno possiamo parlarne!

La mia in assoluto ? la 4 formaggi

Anche se puzza, ci piace?



E voi?


  This forum makes me be fat
Posted by: [SF]kAn3 - 2019-07-14, 01:12 AM - Forum: Chat - Replies (10)

When I read burgershot and see the burger I feel very hungry


  Include files should support "#pragma once"
Posted by: Aerotactics - 2019-07-13, 11:04 PM - Forum: Questions and Suggestions - Replies (1)

Instead of IFDEFINED, ELSE, ENDIF, etc. Include files should support a simple "#PRAGMA once" so that is only loaded once.