Shitbird in need of a simple hand.
#1

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
Reply
#2

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
Reply
#3

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

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
Reply
#5

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.. <.<
Reply
#6

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.

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)