10.08.2013, 19:57
Hello to everyone. I wanted to ask why this command does crash my gamemode! Thanks in advance.
pawn Код:
if(strcmp(cmd, "/vme", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You're not logged in.!");
return 1;
}
GetPlayerRPName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[96];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_WHITE, "USO: /vme [visual action]");
return 1;
}
if(PlayerInfo[playerid][pMask] == 1)
{
format(string, sizeof(string), "> %s", result);
}
else
{
format(string, sizeof(string), "> %s", result);
}
SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 30.0, 15000);
SendClientMessage(playerid, COLOR_PURPLE, "> %s %s", sendername, result);
}
return 1;
}