Little coding questions - For general minor queries 5
#41

I'm working with a mode that uses mini games and I'm trying to think of how to check if all of one team, or in last man standing, if all but one player gets eliminated in mini games. I just can't really think of how. It's there but I can't think of it. Would something like this work? http://pastebin.thegtaplanet.net/pastebin.php?show=450
Reply
#42

Ha, extremely small question here:

What's the sound ID for the little song that plays when you purchase a house/asset in single-player?

Internets and cookie to the one who finds it. I'm pretty sure it's the same one as the mission success jingle.
Reply
#43

Hey guys,

I've got a little problem. I have a login command which does not execute the following line:

pawn Code:
#define PlayerFile "Players/%s.nt"

format(fname,sizeof(fname),PlayerFile,udb_encode(playername));
The problem is, I think, in the udb_encode part but I can't seem to figure out how that is causing it.


Reply
#44

so does that code right there load the file or does it itself?

i usually have like for houses example load bizz

which means to load my bizz.cfg in my scriptfiles
Reply
#45

can you explain yourself a little bit better, I don't know what you are saying..
Reply
#46

ok well in my script when im loading something outside of my GM ok?


i have a few lines like

Load bizz

which will load my bizz.cfg in my scriptfiles

so maybe with your login stuff if you have a file

do fuctions such as

load (file name for players registered here)

then whatever else is supposed to be there with your player login system

i will ad i highly doubt this will work i have never tested it
Reply
#47

no its into the command itself.

pawn Code:
if(!strlen(params))
    {
        SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /login [password]");
    }
    else
    {
      format(fname,sizeof(fname),PlayerFile,udb_encode(playername));
      print("0.4");
        if (fexist(fname)) {
but it doesn't print 0.4
Reply
#48

When the error is "undefined symbol: x".
What i have to do?
The script im doing is:
if (strcmp("/allah", cmdtext, true) == 0)
GetPlayerPos(playerid, x, y, z);
CreateExplosion(x, y, z, 3, 10);
{

return 1;
}
return 0;
}

I know its possible really bad... and you are possibly lauhging about it...
Im not too good at scripting.
Reply
#49

How do I force a player to run a command?
Since the command isnt a function I simply just can not run: myfunction(playerid);
So who do I make a player run the command "/info" automatic?

EDIT:
I found a way:

OnPlayerCommandText(playerid,"/info");
Reply
#50

Quote:
Originally Posted by gatokpo
When the error is "undefined symbol: x".
What i have to do?
The script im doing is:
if (strcmp("/allah", cmdtext, true) == 0)
new Float, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
CreateExplosion(x, y, z, 3, 10);
{

return 1;
}
return 0;
}

I know its possible really bad... and you are possibly lauhging about it...
Im not too good at scripting.
you need to define X, Y and Z
Reply
#51

Quick Question, Pointless in searching for such a random thing, as the search params could be UNBELIEVABLY random

IS it possible to make an array read from a MAX point and a MIN point , so if you wanted to shorted an array for your WEATHER array, is it possible to mkae it loop from MAX weather to MIN weather?
so if the MAX u wanted was 46 and the MIN you wanted was 1?

if so how would you do it? would it be the basic loop?
Reply
#52

well, as you actually said the answer yourself, you could make a timer with a random() function
Reply
#53

Quote:
Originally Posted by Orpheus
if line 140 is a return 1; then its because it outisde your main brackets ;0 e.g u probably have
return 1;
}

too much

Regards Orph
So... how to fix it? :P.
Thanks for the other part , it worked
Reply
#54

Cause the only error i have is:
error 003: declaration of a local variable must appear in a compound block
Reply
#55

you probably have the new Float ... etc OUTSIDe the command or even outside the braces { ... }
Reply
#56

Look what exacly i have is this:

if (strcmp("/allah", cmdtext, true) == 0)
new Float;
new Float:y;
new Float:z;
GetPlayerPos(playerid, x, y, z);
CreateExplosion(x, y, z, 3, 10);
{

return 1;
}
return 0;
}

...
Tell me wahts wrong please :S.
Btw thanks for answering all my noob questions
Reply
#57

if (strcmp("/allah", cmdtext, true) == 0) {
new Float;
new Float:y;
new Float:z;
GetPlayerPos(playerid, x, y, z);
CreateExplosion(x, y, z, 3, 10);

return 1;
}
return 0;
}

you opened your command after the explosion, an IF statement should be opened with a bracet.. read the pawn-lang.pdf
Reply
#58

In Debug, what is the command to spawn a car?

also, We want WIKI back
Reply
#59

WIki Backup
one of the many backups for those who need it
Reply
#60

Quote:
Originally Posted by MATT11504
im having trouble using GetPlayerWeapon.
weaponid = GetPlayerWeapon(playerid)
if (weaponid = 35)
{
SendClientMessage(playerid,COLOR_RED,"TEST");
}
but it says the weaponid = line is an invalid function or decleration and the same for l the if (weaponid = 35) line
any examples of how GetPlayerWeapon is used?
It should be called like this
new weaponid = GetPlayerWeapon(playerid);
if(weaponid == 35) {
SendClientMessage(playerid,COLOR_RED,"Test");
}

You forgot to implement the closing statement on GetPlayerWeapon, and forgot to assign weaponid as a new variable, also you forgot to add the other '=' sign into the IF statement therefore it won't compile properly.
Bye;]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)