Is this possible to convert to r41 code?
#1

I try to update SC-RP gamemodes to r41 version
And i got this one i dont know how it work

PHP код:
        for (new 04++)
        {
            
format(str24"rackWeapon%d"1);
            
RackData[i][rackWeapons][j] = cache_get_field_int(istr);
            
format(str24"rackAmmo%d"1);
            
RackData[i][rackAmmo][j] = cache_get_field_int(istr);
        } 
But i try to fix the code below:

PHP код:
        for (new 04++)
        {
            
format(str24"rackWeapon%d"1);
            
cache_get_value_int(istrRackData[i][rackWeapons][j]);
            
format(str24"rackAmmo%d"1);
            
cache_get_value_int(istrRackData[i][rackAmmo][j]);
        } 
And i got this one error:

PHP код:
error 035argument type mismatch (argument 2
Can anyone explain or help please?
Reply
#2

cache_get_value_name_int

https://sampwiki.blast.hk/wiki/MySQL#cac...value_name_int
Reply
#3

Quote:
Originally Posted by DBZdabIt3Bro7
Посмотреть сообщение
cache_get_value_* its same thing as cache_get_value_name_*, just macro magic

OT: I doubt you can pass column name like that. Try to write by hand the column names. Also this need a database normalization
Reply
#4

I have another question how to change this one

PHP код:
    if (cache_get_value_int(0"Admin") > PlayerData[playerid][pAdmin])
        return 
SendErrorMessage(playerid"You are not authorized to delete a higher admin's character."); 
This is ingame command to delete character in database
And the last problem is below:

PHP код:
                format(stringsizeof(string), "~b~Creation:~w~ %s"GetDuration(gettime() - cache_get_field_int(0"CreateDate")));
                
PlayerTextDrawSetString(extraidPlayerData[extraid][pTextdraws][76], string);
                
format(stringsizeof(string), "~b~Played:~w~ %s"GetDuration(gettime() - cache_get_field_int(0"LastLogin")));
                
PlayerTextDrawSetString(extraidPlayerData[extraid][pTextdraws][77], string); 
Textdraw to show when people create character and last time played
So sorry for this stupid question but i dont really know how to change it
Reply
#5

Well at first one a soultion will be like this:
PHP код:
 new adminLevel;
cache_get_value_int(0"Admin"adminLevel);
if(
adminLeveel PlayerData[playerid][pAdmin])
    return 
SendErrorMessage(playerid"You are not authorized to delete a higher admin's character."); 
And for second one something similar, as in r40 this functions dont return the value anymore you need to pass the value to a variable

PHP код:
new createDate;
                
cache_get_value_int(0"CreateDate"createDate);
                
format(stringsizeof(string), "~b~Creation:~w~ %s"GetDuration(gettime() - createDate)); 
                
PlayerTextDrawSetString(extraidPlayerData[extraid][pTextdraws][76], string); 
Reply
#6

Thank you guys to help me its all work perfectly
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)