Re: Little coding questions - For general minor queries 5 -
Ada32 - 21.03.2015
spawn the player, set cam pos -> do ..
Re: Little coding questions - For general minor queries 5 -
Derexi - 21.03.2015
Can you use format without any specifiers? For example, I have two strings, string1 and string2:
Код:
new string1[6] = "Hello", string2[6];
format(string2, sizeof(string2), string1);
would that work? or would I have to do:
Код:
format(string2, sizeof(string2), "%s", string1);
Re: Little coding questions - For general minor queries 5 -
Ada32 - 21.03.2015
^why not?
edit: woops, actually no. should've proof-read..
Re : Re: Little coding questions - For general minor queries 5 -
ArchB42 - 21.03.2015
Quote:
Originally Posted by Ada32
spawn the player, set cam pos -> do ..
|
Won't work if the player has a big ping or is on his desktop.
@ Derexi
I think there is a strcpy function, not sure (can't check right now). You could also use strcat if you want to make %s%s, string1, string2 into string1.
Re: Little coding questions - For general minor queries 5 -
newbie scripter - 21.03.2015
i'm getting this error when i include
y_ini or physics in my GM
Code:
y_debug.inc(114) : fatal error 100: cannot read from file: "internal\y_funcinc"
but i have another zombie GM in which it has y_ini but i don't get the error.
here is my includes,
Code:
native WP_Hash(buffer[], len, const str[]);
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#include <explosions>
#include <mapandreas>
#include <physics>
#include <YSI\y_ini>
what could've been the problem?
i tried removing either physics or y_ini and tried compiling but it failed. any idea?
Re: Little coding questions - For general minor queries 5 -
liquor - 12.07.2015
Quote:
Originally Posted by Amads
Is 'switch' more effective/faster than 'else ifs'?
|
Yes, slightly, according to
https://sampwiki.blast.hk/wiki/Switch#switch
Re: Little coding questions - For general minor queries 5 -
Evocator - 12.07.2015
why the hell does a ternary operator with an enum crash my compiler?
(IsThis(playerid)) ? ("This") : (sInfo[playerid][pVar])
Re: Little coding questions - For general minor queries 5 -
alexanderjb918 - 13.07.2015
Any idea of turning this into a police speed radar
Код:
RadarHud = TextDrawCreate(499.142883, 3.206666, "usebox");
TextDrawLetterSize(RadarHud, 0.000000, 7.458148);
TextDrawTextSize(RadarHud, 348.095245, 0.000000);
TextDrawAlignment(RadarHud, 1);
TextDrawColor(RadarHud, 0);
TextDrawUseBox(RadarHud, true);
TextDrawBoxColor(RadarHud, 102);
TextDrawSetShadow(RadarHud, 0);
TextDrawSetOutline(RadarHud, 0);
TextDrawFont(RadarHud, 0);
RadarHud = TextDrawCreate(369.523864, 5.546667, "LS-PD SPEED RADAR");
TextDrawLetterSize(RadarHud, 0.297618, 1.442133);
TextDrawAlignment(RadarHud, 1);
TextDrawColor(RadarHud, -1);
TextDrawSetShadow(RadarHud, 0);
TextDrawSetOutline(RadarHud, 1);
TextDrawBackgroundColor(RadarHud, 51);
TextDrawFont(RadarHud, 1);
TextDrawSetProportional(RadarHud, 1);
RadarHud = TextDrawCreate(354.285736, 27.306671, "~n~~r~Speed: kmph");
TextDrawLetterSize(RadarHud, 0.164666, 1.194666);
TextDrawAlignment(RadarHud, 1);
TextDrawColor(RadarHud, -1);
TextDrawSetShadow(RadarHud, 0);
TextDrawSetOutline(RadarHud, 1);
TextDrawBackgroundColor(RadarHud, 51);
TextDrawFont(RadarHud, 1);
TextDrawSetProportional(RadarHud, 1);
RadarHud = TextDrawCreate(411.047698, 26.880001, "~b~Vehicle Model:");
TextDrawLetterSize(RadarHud, 0.149428, 1.450667);
TextDrawAlignment(RadarHud, 1);
TextDrawColor(RadarHud, -1);
TextDrawSetShadow(RadarHud, -34);
TextDrawSetOutline(RadarHud, 0);
TextDrawBackgroundColor(RadarHud, 51);
TextDrawFont(RadarHud, 1);
TextDrawSetProportional(RadarHud, 1);
Re: Little coding questions - For general minor queries 5 -
Evocator - 15.07.2015
I know that there is a relation between kicking delay and the kicked player's ping - i mean if i sent a message, and then delayed the kick as the player's ping (in ms). Will the message get displayed and sent correctly?
Re: Little coding questions - For general minor queries 5 -
iMFear - 15.07.2015
Quote:
Originally Posted by Ralfie
I know that there is a relation between kicking delay and the kicked player's ping - i mean if i sent a message, and then delayed the kick as the player's ping (in ms). Will the message get displayed and sent correctly?
|
It's possible.
But, is more recommended to you, delay the kick in one second. I don't know how many miliseconds the message takes to appear to the client.
Re: Little coding questions - For general minor queries 5 -
Sam15 - 19.07.2015
Can someone give me a small kill system of two classes sniper and soldier.Every time a sniper kills the opponent, he gets 1+class point and vice versa with Soldier.
When both kill the opponent 10 times, they get a minigun. Thete should not be big lapses.
its urgent please...also script about the above as longas you think.
Re: Little coding questions - For general minor queries 5 -
Dan. - 21.07.2015
Anyone know the animation where the player runs for a few meters and then jumps, dives down?
AW: Little coding questions - For general minor queries 5 -
NXGMatze - 23.07.2015
Is there a standard function to put NPCs in Vehicles ? I tried PutPlayerInVehicle, but havent success.
Best regards
Re: AW: Little coding questions - For general minor queries 5 -
Chilli9434 - 23.07.2015
Quote:
Originally Posted by NXGMatze
Is there a standard function to put NPCs in Vehicles ? I tried PutPlayerInVehicle, but havent success.
Best regards
|
https://sampforum.blast.hk/showthread.php?tid=170545
try searching around next time
Re: Little coding questions - For general minor queries 5 -
b3nz - 24.07.2015
What's wrong here? The code works though.
pawn Код:
#define CheckIfUpper(%0) (%0 > 64 && %0 < 94)
if (CheckIfUpper ('A'))
printf ("It's upper!");
Код:
warning 206: redundant test: constant expression is non-zero
Re: Little coding questions - For general minor queries 5 -
xVIP3Rx - 24.07.2015
Quote:
Originally Posted by b3nz
What's wrong here? The code works though.
pawn Код:
#define CheckIfUpper(%0) (%0 > 64 && %0 < 94)
if (CheckIfUpper ('A')) printf ("It's upper!");
Код:
warning 206: redundant test: constant expression is non-zero
|
pawn Код:
#define CheckIfUpper(%0) (64 < %0 && %0 < 94)
public OnPlayerConnect(playerid)
{
new a = 'A';
if(CheckIfUpper(a)) printf ("It's upper!");
}
Thanks to Vince
Quote:
Originally Posted by Vince
You can't write an if-statement without some kind of variable.
|
Re: Little coding questions - For general minor queries 5 -
b3nz - 24.07.2015
Right, totally forgot this. Thanks!
Re: Little coding questions - For general minor queries 5 -
CrossUSAAF - 26.07.2015
I got three dimensional array, where I would like to store spawn information of each team.
In example:
pawn Код:
new const Float:Array[][][] = {{{// X, Y, Z, A}}};
However, when I try to get a random item of a team spawn with
pawn Код:
new rand = random(sizeof(Array[team]));
, it gives me the following error:
Quote:
: error 001: expected token: "]", but found "-identifier-"
: warning 215: expression has no effect
: error 001: expected token: ";", but found "]"
: error 029: invalid expression, assumed zero
: fatal error 107: too many error messages on one line
|
How to fix this?
AW: Re: Little coding questions - For general minor queries 5 -
Nero_3D - 26.07.2015
In pawn all dimensions are predefined and have the fixed size, therefore
pawn Код:
new rand = random(sizeof(Array[]));
Re: Little coding questions - For general minor queries 5 -
xVIP3Rx - 28.07.2015
so this works
pawn Код:
new blabla[MAX_PLAYERS] = {-1, ...};
how do I do this..
pawn Код:
new blabla[MAX_PLAYERS][MAX_PLAYERS] = {{-1, ...}, ...};
Another thing, whenever I do this the new checkpoint takes the old size, (Is that a native samp bug ? )
Don't want to use a streamer.
pawn Код:
SetPlayerCheckpoint(id, x, y, z, size);
DisablePlayerCheckpoint(i);
SetPlayerCheckpoint(id, x, y, z, newsize);