I got two questions < Please Help Me !
#1

I am going straight on the questions ..

1.
Lets say i got this command in the script:
pawn Код:
if(!strcmp(cmdtext, "/do", true, strlen("/do")))
    {
    new len = strlen("/do");
    if (!strlen(cmdtext[len+1])) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /do [Situation]");
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof name);
    format(cmdtext, 128, "* %s ( %s ) ", cmdtext[len+1], name );
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    for(new i, m = GetMaxPlayers(); i < m; i++) if (IsPlayerConnected(i))
    {
    if (IsPlayerInRangeOfPoint(i, 15.0, x, y, z)) SendClientMessage(i, COLOR_PURPLE, cmdtext);
    }
    return 1;
    }
Okay , everything is working alright but the problem is if i type "/dobananas" instead of "/do bananas" it says "ananas (Firstname_Lastname)"
How i can make it says "Unknown command"
PS1 - This problem is for almost all of my commands (/me, /do, /b, /shout, /low and etc.).
PS2 - I am trying to make a RPG server.

2.
I got this script to check if the character is inside clothing shop (interior) and if so you can change your skin by /clothes [Skin ID]:
pawn Код:
new cmd[256];
    if(strcmp(cmd, "/clothes", true) == 0)
    {
    if(IsPlayerInRangeOfPoint(playerid, 15.0, 161.37, -96.61, 1001.80))
    {
    new idx;
    new tmp[256];
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /clothes [Skin ID]");
    return 1;
    }
    new level;
    level = strval(tmp);
    SetPlayerSkin(playerid, level);
    return 1;
    }
   else
  {
     SendClientMessage(playerid, COLOR_RED, "You are not in clothing shop !");
     }
    }
The problem is weird and i can not explain it well but i will try: There is no errors in compiling but In Game it tells me "You are not in clothing shop !" on every command i type.
PS - If you can edit my script or make another which do the same thing :P



PS2 - Dont blame me if you think i am noob - i started to learn how to script just some days ago ! ! !
Reply


Messages In This Thread
I got two questions < Please Help Me ! - by Varna - 08.06.2010, 15:22
Re: I got two questions < Please Help Me ! - by billiout - 08.06.2010, 15:47
Re: I got two questions < Please Help Me ! - by Assyria - 08.06.2010, 15:52
Re: I got two questions < Please Help Me ! - by Jakku - 08.06.2010, 16:54
Re: I got two questions < Please Help Me ! - by Varna - 08.06.2010, 19:17
Re: I got two questions < Please Help Me ! - by Varna - 09.06.2010, 16:26
Re: I got two questions < Please Help Me ! - by Ady.b - 05.07.2010, 19:54

Forum Jump:


Users browsing this thread: 1 Guest(s)