08.06.2010, 15:22
I am going straight on the questions ..
1.
Lets say i got this command in the script:
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]:
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 ! ! !
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;
}
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 !");
}
}
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 ! ! !