Little coding questions - For general minor queries 5

Quote:
Originally Posted by IstuntmanI
View Post
Code:
UPDATE `Table` SET `Column` = `Column` - 3 WHERE `Player` = %d
Thanks.
Reply

Does 'GetPlayerTargetPlayer' work with fists when you press right mouse button and a triangle appears over the other player's head?
Reply

Quote:
Originally Posted by Amads
View Post
Does 'GetPlayerTargetPlayer' work with fists when you press right mouse button and a triangle appears over the other player's head?
Yes.
Reply

Why doesn't easybmp.dll work for me? I have the latest .NET frameworks, updated permissions and run the file as an admin.

Got it from here: https://github.com/grasmanek94/SA-MP.../master/server

pawn Code:
plugins streamer mapandreas eb
pawn Code:
[00:06:18]
[00:06:18] Server Plugins
[00:06:18] --------------
[00:06:18]  Loading plugin: streamer
[00:06:18]

*** Streamer Plugin v2.7.8 by Incognito loaded ***

[00:06:18]   Loaded.
[00:06:18]  Loading plugin: mapandreas
[00:06:18]   Loaded.
[00:06:18]  Loading plugin: eb
[00:06:18]   Failed.
[00:06:18]  Loaded 2 plugins.
Reply

For some reason he compiled it with the debug version and requires both msvcp100d.dll and msvcr100d.dll

Pottus/Crayder have these two files for Texture Studio:
https://github.com/Pottus/Texture-St...d.dll?raw=true
https://github.com/Pottus/Texture-St...d.dll?raw=true
Reply

Quote:
Originally Posted by Konstantinos
View Post
For some reason he compiled it with the debug version and requires both msvcp100d.dll and msvcr100d.dll

Pottus/Crayder have these two files for Texture Studio:
https://github.com/Pottus/Texture-St...d.dll?raw=true
https://github.com/Pottus/Texture-St...d.dll?raw=true
Hey, thanks man. I ******d for hours on the end but couldn't find anything. Saved me some trouble.
Reply

Fixed!
Reply

How can I put default values with sscanf ? Like if the player isn't using a variable, so the variable take the default value like a function.
Reply

Code:
sscanf(string, "d(123)f(3.14)", intvar, floatvar);
Put the default value right after specifier, enclosed by parantheses

// Oh, sorry! Long time, no s...scanf
Reply

Quote:
Originally Posted by AMouldyLemon
Посмотреть сообщение
I need the sizeof "Element" at a specific index such as 5..
This is impossible...cause think about a Variable get stored...

You have to use a define for this
Reply

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Debug it to see what value the variable holds and what gettime returns. If the values are pretty much close, you will most likely need to check ErrorMsg for any mistake that messes the arguments. If not, just make sure TPS_PM is really 30 because I can't think of any other reason.
I made some test, result the same thing.

PHP код:
    new temp PmTime[playerid] - gettime();
    
SCMF(playerid, -1"temp = %i"temp);
    if(
PmTime[playerid] && PmTime[playerid] > gettime())
        
ErrorMsg(playerid"Vous devez attendre encore %i sec avant d'envoyer un PM."_temp);
        
ErrorMsg(playerid"Vous devez attendre encore %i sec avant d'envoyer un PM."temp); // also i tried this one, same thing 
    
new str[120];
    
format(strsizeof(str), "- Vous devez attendre encore %i sec avant d'envoyer un PM."temp);
    
SendClientMessageToAll(-1str); 
Код:
[18:58:12] temp = -1474563492 // this is ok
[18:58:12] - Vous devez attendre encore -1474563492 sec avant d'envoyer un PM. // same thing, it's k

[18:58:12] temp = 30 // alright, we have the right value
[18:58:12] [Erreur] Vous devez attendre encore 1920091483 sec avant d'envoyer un PM. // wtf?
[18:58:12] - Vous devez attendre encore 30 sec avant d'envoyer un PM.' // the right value there
So I modified the ErrorMsg
PHP код:
ErrorMsg(playerid, const msg[] = EOSallowed trueva_args<>)
{
    new 
message[190];
    
va_format(messagesizeof(message), msgva_start<3>);
    if(!
allowed)
        return 
SCMF(playeridREDF"[Erreur] Vous n'кtes pas autorisй а utiliser cette commande.");
    return 
SCMF(playeridREDF"[Erreur] %s"msg);

EDIIIT:
Solved; As you Konst' said the problem came from my function. '-'
PHP код:
stock ErrorMsg(playeridallowed true, const msg[] = EOSva_args<>)
{
    new 
message[190];
    static const 
premsg[] = "[Erreur] %s";
    if(!
allowed)
        return 
SCMF(playeridREDF"[Erreur] Vous n'кtes pas autorisй а utiliser cette commande.");
    if(
numargs() == 2)
        return 
SCMF(playeridREDFpremsgmsg);
    
va_format(messagesizeof(message), msgva_start<3>);
    return 
SCMF(playeridREDF"[Erreur] %s"message);

Reply

PHP код:
new bool:male false;
new 
gender[11];
gender = (male ? ("Male") : ("Female"));
printf("%s\n"gender);
result"Femal" (NOT a typo
I've tried with multiple characters after "Femal", still prints "Femal". I've tried making "gender" larger, still the same problem.
Reply

I don't know why this happens but swapping them fixes the issue:
pawn Код:
gender = !male ? ("Female") : ("Male");
Reply

The problem is the "movs" instruction because the number of bytes need to be known beforehand, it takes it from the first argument
Reply

I need a command that will fine (take some money) players who are offline at that moment....i have command for online but not for online...e.g like \offlinefine [playername(it should check if player exists or not)[amount][reason]

Im using Zcmd and y_ini
Reply

^^ above post (3385)

PHP код:
// indent the code yourself - just an example.
new targetname[24], fineefilestring[79];
if(
sscanf(params"s[24]d"targetnamefinee)) return SendClientMessage(playerid, -1"{C0C0C0}USAGE: /offlinefine [Player Name] [fine]");
format(filestringsizeof(filestring), "location/%s.ini"targetname);
if(!
fexist(filestring)) return SendClientMessage(playerid, -1"The player name you have chosen was not found in our system.");
new 
INI:File INI_Open(filestring);
// set player tag
// take fine and put the fine value 
INI_Close(File);
// done! 
You can also save the offline fine string and let the player know when they connect.
Reply

Quote:
Originally Posted by ALiScripter
Посмотреть сообщение
^^ above post (3385)

PHP код:
// indent the code yourself - just an example.
new targetname[24], fineefilestring[79];
if(
sscanf(params"s[24]d"targetnamefinee)) return SendClientMessage(playerid, -1"{C0C0C0}USAGE: /offlinefine [Player Name] [fine]");
format(filestringsizeof(filestring), "location/%s.ini"targetname);
if(!
fexist(filestring)) return SendClientMessage(playerid, -1"The player name you have chosen was not found in our system.");
new 
INI:File INI_Open(filestring);
// set player tag
// take fine and put the fine value 
INI_Close(File);
// done! 
You can also save the offline fine string and let the player know when they connect.
how to set tag mate? i really have no idea about it...
Reply

^^ In your script you must be using tags for the saving files. I would recommend you to move towards MySQL, download MySQL r40 and use the example script for learning purpose, upgrade to MySQL r41 and use the example script for a base of MySQL. If your OS doesn't supports r40+ use r39-6, as I am using it too. MySQL is relatively easier and better.
Reply

Ohhh sure if i upgrade to mysql..i will have to rewrite my script or something?
Reply

hey,

in the beginning of my filterscript i load all animations, just to be sure that they will be played without having to type the command twice.
However it crashed the player, is there a safer way to do it ? Or is it just impossible to load every libraries at the same time?

thanks!
Reply


Forum Jump:


Users browsing this thread: 6 Guest(s)