SA-MP Forums Archive
Shitbird in need of a simple hand. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Shitbird in need of a simple hand. (/showthread.php?tid=98255)



Shitbird in need of a simple hand. - shitbird - 19.09.2009

Hey lads n lassies, so i've started to script a bit again, and now i need cho help...

I'm trying to create a variable, and that variable is the Players text after /block <the blocks name>...

pawn Код:
dcmd_block(playerid, params[])
{
    new
        string[128];
    if (sscanf(params, "s", string)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/block <block name>\"");
    {
      Block[playerid] == string;
    }
    return 1;
}
I don't know how to do the Block[playerid] == string; thing...

Help a bird out here


Re: Shitbird in need of a simple hand. - brett7 - 19.09.2009

dcmd_block(playerid, params[])
{
new string[128];
if (sscanf(params, "s", string))
{
SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/block <block name>\"");
Block[playerid] == string;
}
return 1;
}

thats a bit of formatting help but i dont understand why you would want to set it as a string


Re: Shitbird in need of a simple hand. :( - shitbird - 19.09.2009

... how do you make a player's text become a string....


Re: Shitbird in need of a simple hand. - Annihalation - 19.09.2009

you'll want to get sscanf. It basically scans a players input for whatever you specify. Look it up in the help part of Sa-mp instead of the forum part. You will learn about it quickly


Re: Shitbird in need of a simple hand. - shitbird - 19.09.2009

I know how to do admin commands and alot of other stuff, i also did once know how to do this, but i have totally forgotten it.. <.<


Re: Shitbird in need of a simple hand. - shitbird - 19.09.2009

Sorry for double posting, but you know when you're tired and can't do anything else for tonight and doing the last thing before you go to bed? yeah...

Okay, i'm going to try and explain it..

pawn Код:
dcmd_block(playerid, params[])
{
    new
        string[128];
    if (sscanf(params, "s", string))
    {
        SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/block <block name>\"");
        } else { ScooterBlock[playerid] = string;
    }
    return 1;
}
Player enters server...
Player Block is nothing because the variable isnt set when he joins.

Player decides to make his own block, he does /block <Huja>
Player Block Variable becomes == Input (and in that case, it's Huja).

Now, this explains that : Player uses /Block Huja, and it turns the Variable (Block[playerid] to Huja, but Huja in that case was a custom input (string) so now i want /block <BLOCK NAME> to be the variable... now how the hell do you make that work..

Goodnight <3.