23.02.2010, 16:40
Hello again, I'm trying to create a /showbadge command but I got some small confusions, this is how it looks like so far:
I think it misses something that keeps the player distance?
I hope you know what I mean, thanks
Code:
if(strcmp(cmd, "/showbadge", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, " USAGE: /showbadge [playerid]");
return 1;
}
new para1;
para1 = ReturnUser(tmp);
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pLAERank] >= 1)
{
if(IsPlayerConnected(para1))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, " USAGE: /showbadge [playerid]");
return 1;
}
format(string, sizeof(string), "Police Officer %s BlahBlah...", sendername);
SendClientMessage(para1, COLOR_BLUE, string);
format(string, sizeof(string), "You have shown %s your badge.", giveplayer);
SendClientMessage(playerid, COLOR_BLUE, string);
return 1;
}
}
}
}
return 1;
}
I hope you know what I mean, thanks

