public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(cmdtext,"/help",true)==0) { SendClientMessage(playerid, HOT_PINK,"Cherry Poppers Deathmatch is a deathmatch created by Cherry Poppers clan."); SendClientMessage(playerid, HOT_PINK,"It's mainly based in Angel Pine with small links to San Fierro and Los Santos,"); SendClientMessage(playerid, HOT_PINK,"this is so the city dwellers can use mod shops, banks and extra ammunations."); SendClientMessage(playerid, HOT_PINK,"For command list please type '/commands\'."); return 1; } new idx; new cmd[30]; cmd = strtok(cmdtext,idx); if (strcmp(cmd,"/unarrest",true)==0) { new tmp[256]; new arrestid; tmp = strtok(cmdtext, idx); arrestid = strval(tmp); TogglePlayerControllable(arrestid, 1); } if (strcmp(cmd,"/arrest",true)==0) { new tmp[256]; new arrestid; new vehicleid = GetPlayerVehicleID(playerid); new Float:player_x,Float:player_y,Float:player_z; new Float:arrest_x,Float:arrest_y,Float:arrest_z; tmp = strtok(cmdtext, idx); arrestid = strval(tmp); GetPlayerPos(playerid, player_x,player_y,player_z); GetPlayerPos(playerid, arrest_x,arrest_y,arrest_z); if (vehicleid != 0) { if(IsPlayerConnected(arrestid) && (player_x-arrest_x == 4.0 || -4.0) && (player_y-arrest_y == 4.0 || -4.0) && (player_z-arrest_z == 10.0 || -10.0)) { PutPlayerInVehicle(arrestid,vehicleid,1); TogglePlayerControllable(arrestid, 0); } else if((player_x-arrest_x != 4.0 || -4.0) && (player_y-arrest_y != 4.0 || -4.0) && (player_z-arrest_z != 10.0 || -10.0)) { SendClientMessage(playerid, WHITE,"Please get closer to the criminal"); } else { SendClientMessage(playerid, WHITE,"Please arrest a connected player."); } return 1; } else { SendClientMessage(playerid,WHITE,"You must be in a vehicle to arrest!"); } return 1; } return 1; }