Version 1
...
add this
new Gone[MAX_PLAYERS];
new bReason[MAX_PLAYERS];
Now Commands
else if(strcmp(cmd,"brb", true) == 0) {
tmp = strtok( cmdtext, idx );
if ( !strlen( tmp ) ) SendClientMessage( playerid, COLOR_GREEN, "Usage: /c brb [reason] [time]" );
else {
new tmp2[123];
tmp2 = strtok( cmdtext, idx );
new str[123];
Gone[playerid] = 1;
pReason[playerid] = strlen(tmp);
TogglePlayerControllable(playerid,0);
format(str, 123, " %s Will be Right Back In %d Minutes. Reason %s ", gPlayers[playerid], tmp2, tmp);
SendClientMessageToAll(COLOR_GREEN,str);
}
return 1;
}
else if(strcmp(cmd,"back", true) == 0) {
new str[123];
Gone[playerid] = 0;
TogglePlayerControllable(playerid,1);
format(str, 123, " %s Is Back From %s ", gPlayers[playerid], pReason[playerid]);
SendClientMessageToAll(COLOR_GREEN,str);
return 1;
}
onplayerdeath
if(Gone[playerid] == 1) {
SetPlayerHealth(killerid,0);
SendClientMessage(killerid,COLOR_RED," Auto Kill For Type Kill ");
}
Version 2
new bReason[][] = {
" Toilet ",
" Eating ",
" Tired ",
" Later ",
" Going To Sleep ",
" Going Somewhere "
};
put cmd in onplayertext
else if(strcmp(cmd,"brb", true) == 0) {
new randx = random(sizeof(bReason);
new ms[123];
format(ms,sizeof(ms)," %s Will Be Right Back Reason : %s ", gPlayers[playerid], bReason[randx][randx]);
SendClientMessageToAll(COLOR_GREEN,ms);
return 1;
}
[code]else if(strcmp(cmd,"back", true) == 0) {
new randx = random(sizeof(bReason);
new ms[123];
format(ms,sizeof(ms)," %s Is Back From %s ", gPlayers[playerid], bReason[randx][randx]);
SendClientMessageToAll(COLOR_GREEN,ms);
return 1;
}