04.01.2018, 22:07
Is it possibile to convert this in a CMD command type?
If it is possibile, can you help me?
If it is possibile, can you help me?
Quote:
public OnPlayerCommandText(playerid, cmdtext[]) { new cmd[256], idx, tmp[256], string[256]; cmd = strtok(cmdtext, idx); if(strcmp(cmd, "/int", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, 0xFFFFFFAA, "USAGE: /int [id]"); return 1; } new playa; playa = strval(tmp); if(playa < 146 && playa >= 0) { format(string, sizeof(string), "Int %d: %s", playa, IntName[playa]); SendClientMessage(playerid, 0xFFFFFFAA, string); SetPlayerInterior(playerid, IntArray2[playa][0]); SetPlayerPos(playerid, IntArray[playa][0], IntArray[playa][1], IntArray[playa][2]); SetPlayerFacingAngle(playerid, IntArray[playa][3]); return 1; } } return 1; } if(strcmp(cmd, "/intlist", true) == 0) { if(IsPlayerConnected(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, 0xFFFFFFAA, "USAGE: /intlist [startid]"); return 1; } new playa; playa = strval(tmp); if(playa < 146 && playa >= 0) { format(string, sizeof(string), "Int %d: %s", playa, IntName[playa]); SendClientMessage(playerid, 0xFFFFFFAA, string); new intid = playa+1; while(intid < playa+10) { if(intid < 146 && intid >= 0) { format(string, sizeof(string), "Int %d: %s", intid, IntName[intid]); SendClientMessage(playerid, 0xFFFFFFAA, string); } intid += 1; } return 1; } } return 1; } return 0; } |